Reference documentation and code samples for the Google Cloud Asset V1 Client class AssetServiceClient.
Service Description: Asset service definition.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
This class is currently experimental and may be subject to changes. See Google\Cloud\Asset\V1\AssetServiceClient for the stable implementation
Namespace
Google \ Cloud \ Asset \ V1 \ ClientMethods
__construct
Constructor.
options
array
Optional. Options for configuring the service API wrapper.
↳ apiEndpoint
string
The address of the API remote host. May optionally include the port, formatted as "
↳ credentials
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage : In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.
↳ credentialsConfig
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
↳ disableRetries
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false
.
↳ clientConfig
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
↳ transport
string|TransportInterface
The transport used for executing network requests. May be either the string rest
or grpc
. Defaults to grpc
if gRPC support is detected on the system. Advanced usage
: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface
object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
↳ transportConfig
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
↳ clientCertSource
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
analyzeIamPolicy
Analyzes IAM policies to answer which identities have what accesses on which resources.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeIamPolicyAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeIamPolicyLongrunning
Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse .
This method implements the google.longrunning.Operation , which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeIamPolicyLongrunningAsync() .
request
Google\Cloud\Asset\V1\AnalyzeIamPolicyLongrunningRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeMove
Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations.
The policies and configuration are subject to change before the actual resource migration takes place.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeMoveAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeOrgPolicies
Analyzes organization policies under a scope.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeOrgPoliciesAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeOrgPolicyGovernedAssets
Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints:
- storage.uniformBucketLevelAccess
- iam.disableServiceAccountKeyCreation
- iam.allowedPolicyMemberDomains
- compute.vmExternalIpAccess
- appengine.enforceServiceAccountActAsCheck
- gcp.resourceLocations
- compute.trustedImageProjects
- compute.skipDefaultNetworkCreation
- compute.requireOsLogin
- compute.disableNestedVirtualization
This RPC only returns either resources of types supported by searchable asset types , or IAM policies.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeOrgPolicyGovernedAssetsAsync() .
request
Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedAssetsRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeOrgPolicyGovernedContainers
Analyzes organization policies governed containers (projects, folders or organization) under a scope.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::analyzeOrgPolicyGovernedContainersAsync() .
request
Google\Cloud\Asset\V1\AnalyzeOrgPolicyGovernedContainersRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
batchGetAssetsHistory
Batch gets the update history of assets that overlap a time window.
For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::batchGetAssetsHistoryAsync() .
request
Google\Cloud\Asset\V1\BatchGetAssetsHistoryRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
batchGetEffectiveIamPolicies
Gets effective IAM policies for a batch of resources.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::batchGetEffectiveIamPoliciesAsync() .
request
Google\Cloud\Asset\V1\BatchGetEffectiveIamPoliciesRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createFeed
Creates a feed in a parent project/folder/organization to listen to its asset updates.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::createFeedAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
createSavedQuery
Creates a saved query in a parent project/folder/organization.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::createSavedQueryAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
deleteFeed
Deletes an asset feed.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::deleteFeedAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
deleteSavedQuery
Deletes a saved query.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::deleteSavedQueryAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
exportAssets
Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a google.cloud.asset.v1.Asset in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the google.longrunning.Operation API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::exportAssetsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getFeed
Gets details about an asset feed.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::getFeedAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
getSavedQuery
Gets details about a saved query.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::getSavedQueryAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listAssets
Lists assets with time and resource types and returns paged results in response.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::listAssetsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listFeeds
Lists all asset feeds in a parent project/folder/organization.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::listFeedsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
listSavedQueries
Lists all saved queries in a parent project/folder/organization.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::listSavedQueriesAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
queryAssets
Issue a job that queries assets using a SQL statement compatible with BigQuery SQL .
If the query execution finishes within timeout and there's no pagination,
the full query results will be returned in the QueryAssetsResponse
.
Otherwise, full query results can be obtained by issuing extra requests
with the job_reference
from the a previous QueryAssets
call.
Note, the query result has approximately 10 GB limitation enforced by BigQuery . Queries return larger results will result in errors.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::queryAssetsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
searchAllIamPolicies
Searches all IAM policies within the specified scope, such as a project,
folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies
permission on the desired scope,
otherwise the request will be rejected.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::searchAllIamPoliciesAsync() .
request
Google\Cloud\Asset\V1\SearchAllIamPoliciesRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
searchAllResources
Searches all Google Cloud resources within the specified scope, such as a
project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources
permission on the desired scope,
otherwise the request will be rejected.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::searchAllResourcesAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
updateFeed
Updates an asset feed configuration.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::updateFeedAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
updateSavedQuery
Updates a saved query.
The async variant is Google\Cloud\Asset\V1\Client\AssetServiceClient::updateSavedQueryAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
analyzeIamPolicyAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
analyzeIamPolicyLongrunningAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
analyzeMoveAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
analyzeOrgPoliciesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
analyzeOrgPolicyGovernedAssetsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
analyzeOrgPolicyGovernedContainersAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
batchGetAssetsHistoryAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
batchGetEffectiveIamPoliciesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
createFeedAsync
GuzzleHttp\Promise\PromiseInterface
createSavedQueryAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
deleteFeedAsync
GuzzleHttp\Promise\PromiseInterface
deleteSavedQueryAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
exportAssetsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getFeedAsync
GuzzleHttp\Promise\PromiseInterface
getSavedQueryAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
listAssetsAsync
GuzzleHttp\Promise\PromiseInterface
listFeedsAsync
GuzzleHttp\Promise\PromiseInterface
listSavedQueriesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
queryAssetsAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
searchAllIamPoliciesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
searchAllResourcesAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
updateFeedAsync
GuzzleHttp\Promise\PromiseInterface
updateSavedQueryAsync
optionalArgs = []
array
GuzzleHttp\Promise\PromiseInterface
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
operationName
string
The name of the long running operation
methodName
string
The name of the method used to start the operation
static::feedName
Formats a string containing the fully-qualified path to represent a feed resource.
project
string
feed
string
string
static::folderName
Formats a string containing the fully-qualified path to represent a folder resource.
folder
string
string
static::folderFeedName
Formats a string containing the fully-qualified path to represent a folder_feed resource.
folder
string
feed
string
string
static::folderSavedQueryName
Formats a string containing the fully-qualified path to represent a folder_saved_query resource.
folder
string
savedQuery
string
string
static::organizationName
Formats a string containing the fully-qualified path to represent a organization resource.
organization
string
string
static::organizationFeedName
Formats a string containing the fully-qualified path to represent a organization_feed resource.
organization
string
feed
string
string
static::organizationSavedQueryName
Formats a string containing the fully-qualified path to represent a organization_saved_query resource.
organization
string
savedQuery
string
string
static::projectName
Formats a string containing the fully-qualified path to represent a project resource.
project
string
string
static::projectFeedName
Formats a string containing the fully-qualified path to represent a project_feed resource.
project
string
feed
string
string
static::projectSavedQueryName
Formats a string containing the fully-qualified path to represent a project_saved_query resource.
project
string
savedQuery
string
string
static::savedQueryName
Formats a string containing the fully-qualified path to represent a saved_query resource.
project
string
savedQuery
string
string
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- feed: projects/{project}/feeds/{feed}
- folder: folders/{folder}
- folderFeed: folders/{folder}/feeds/{feed}
- folderSavedQuery: folders/{folder}/savedQueries/{saved_query}
- organization: organizations/{organization}
- organizationFeed: organizations/{organization}/feeds/{feed}
- organizationSavedQuery: organizations/{organization}/savedQueries/{saved_query}
- project: projects/{project}
- projectFeed: projects/{project}/feeds/{feed}
- projectSavedQuery: projects/{project}/savedQueries/{saved_query}
- savedQuery: projects/{project}/savedQueries/{saved_query}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
formattedName
string
The formatted name string
template
string
Optional name of template to match
array