pub struct AssetService { /* private fields */ }Expand description
Implements a client for the Cloud Asset API.
§Example
let client = AssetService::builder().build().await?;
// use `client` to make requests to the Cloud Asset API.§Service Description
Asset service definition.
§Configuration
To configure AssetService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://cloudasset.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
AssetService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap AssetService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl AssetService
impl AssetService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for AssetService.
let client = AssetService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: AssetService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: AssetService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn export_assets(&self) -> ExportAssets
pub fn export_assets(&self) -> 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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn list_assets(&self) -> ListAssets
pub fn list_assets(&self) -> ListAssets
Lists assets with time and resource types and returns paged results in response.
Sourcepub fn batch_get_assets_history(&self) -> BatchGetAssetsHistory
pub fn batch_get_assets_history(&self) -> 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.
Sourcepub fn create_feed(&self) -> CreateFeed
pub fn create_feed(&self) -> CreateFeed
Creates a feed in a parent project/folder/organization to listen to its asset updates.
Sourcepub fn list_feeds(&self) -> ListFeeds
pub fn list_feeds(&self) -> ListFeeds
Lists all asset feeds in a parent project/folder/organization.
Sourcepub fn update_feed(&self) -> UpdateFeed
pub fn update_feed(&self) -> UpdateFeed
Updates an asset feed configuration.
Sourcepub fn delete_feed(&self) -> DeleteFeed
pub fn delete_feed(&self) -> DeleteFeed
Deletes an asset feed.
Sourcepub fn search_all_resources(&self) -> SearchAllResources
pub fn search_all_resources(&self) -> 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.
Sourcepub fn search_all_iam_policies(&self) -> SearchAllIamPolicies
pub fn search_all_iam_policies(&self) -> 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.
Sourcepub fn analyze_iam_policy(&self) -> AnalyzeIamPolicy
pub fn analyze_iam_policy(&self) -> AnalyzeIamPolicy
Analyzes IAM policies to answer which identities have what accesses on which resources.
Sourcepub fn analyze_iam_policy_longrunning(&self) -> AnalyzeIamPolicyLongrunning
pub fn analyze_iam_policy_longrunning(&self) -> 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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn analyze_move(&self) -> AnalyzeMove
pub fn analyze_move(&self) -> 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.
Sourcepub fn query_assets(&self) -> QueryAssets
pub fn query_assets(&self) -> 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.
Sourcepub fn create_saved_query(&self) -> CreateSavedQuery
pub fn create_saved_query(&self) -> CreateSavedQuery
Creates a saved query in a parent project/folder/organization.
Sourcepub fn get_saved_query(&self) -> GetSavedQuery
pub fn get_saved_query(&self) -> GetSavedQuery
Gets details about a saved query.
Sourcepub fn list_saved_queries(&self) -> ListSavedQueries
pub fn list_saved_queries(&self) -> ListSavedQueries
Lists all saved queries in a parent project/folder/organization.
Sourcepub fn update_saved_query(&self) -> UpdateSavedQuery
pub fn update_saved_query(&self) -> UpdateSavedQuery
Updates a saved query.
Sourcepub fn delete_saved_query(&self) -> DeleteSavedQuery
pub fn delete_saved_query(&self) -> DeleteSavedQuery
Deletes a saved query.
Sourcepub fn batch_get_effective_iam_policies(&self) -> BatchGetEffectiveIamPolicies
pub fn batch_get_effective_iam_policies(&self) -> BatchGetEffectiveIamPolicies
Gets effective IAM policies for a batch of resources.
Sourcepub fn analyze_org_policies(&self) -> AnalyzeOrgPolicies
pub fn analyze_org_policies(&self) -> AnalyzeOrgPolicies
Analyzes organization policies under a scope.
Sourcepub fn analyze_org_policy_governed_containers(
&self,
) -> AnalyzeOrgPolicyGovernedContainers
pub fn analyze_org_policy_governed_containers( &self, ) -> AnalyzeOrgPolicyGovernedContainers
Analyzes organization policies governed containers (projects, folders or organization) under a scope.
Sourcepub fn analyze_org_policy_governed_assets(
&self,
) -> AnalyzeOrgPolicyGovernedAssets
pub fn analyze_org_policy_governed_assets( &self, ) -> AnalyzeOrgPolicyGovernedAssets
Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following canned constraints:
- constraints/ainotebooks.accessMode
- constraints/ainotebooks.disableFileDownloads
- constraints/ainotebooks.disableRootAccess
- constraints/ainotebooks.disableTerminal
- constraints/ainotebooks.environmentOptions
- constraints/ainotebooks.requireAutoUpgradeSchedule
- constraints/ainotebooks.restrictVpcNetworks
- constraints/compute.disableGuestAttributesAccess
- constraints/compute.disableInstanceDataAccessApis
- constraints/compute.disableNestedVirtualization
- constraints/compute.disableSerialPortAccess
- constraints/compute.disableSerialPortLogging
- constraints/compute.disableVpcExternalIpv6
- constraints/compute.requireOsLogin
- constraints/compute.requireShieldedVm
- constraints/compute.restrictLoadBalancerCreationForTypes
- constraints/compute.restrictProtocolForwardingCreationForTypes
- constraints/compute.restrictXpnProjectLienRemoval
- constraints/compute.setNewProjectDefaultToZonalDNSOnly
- constraints/compute.skipDefaultNetworkCreation
- constraints/compute.trustedImageProjects
- constraints/compute.vmCanIpForward
- constraints/compute.vmExternalIpAccess
- constraints/gcp.detailedAuditLoggingMode
- constraints/gcp.resourceLocations
- constraints/iam.allowedPolicyMemberDomains
- constraints/iam.automaticIamGrantsForDefaultServiceAccounts
- constraints/iam.disableServiceAccountCreation
- constraints/iam.disableServiceAccountKeyCreation
- constraints/iam.disableServiceAccountKeyUpload
- constraints/iam.restrictCrossProjectServiceAccountLienRemoval
- constraints/iam.serviceAccountKeyExpiryHours
- constraints/resourcemanager.accessBoundaries
- constraints/resourcemanager.allowedExportDestinations
- constraints/sql.restrictAuthorizedNetworks
- constraints/sql.restrictNoncompliantDiagnosticDataAccess
- constraints/sql.restrictNoncompliantResourceCreation
- constraints/sql.restrictPublicIp
- constraints/storage.publicAccessPrevention
- constraints/storage.restrictAuthTypes
- constraints/storage.uniformBucketLevelAccess
This RPC only returns either resources of types supported by search APIs or IAM policies.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for AssetService
impl Clone for AssetService
Source§fn clone(&self) -> AssetService
fn clone(&self) -> AssetService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more