Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

CloudAsset

import { CloudAsset } from "https://googleapis.deno.dev/v1/cloudasset:v1.ts";

The Cloud Asset API manages the history and inventory of Google Cloud resources.

class CloudAsset {
constructor(client?: CredentialsClient, baseUrl?: string);
async assetsList(parent: string, opts?: AssetsListOptions): Promise<ListAssetsResponse>;
async effectiveIamPoliciesBatchGet(scope: string, opts?: EffectiveIamPoliciesBatchGetOptions): Promise<BatchGetEffectiveIamPoliciesResponse>;
async feedsCreate(parent: string, req: CreateFeedRequest): Promise<Feed>;
async feedsDelete(name: string): Promise<Empty>;
async feedsGet(name: string): Promise<Feed>;
async feedsList(parent: string): Promise<ListFeedsResponse>;
async feedsPatch(name: string, req: UpdateFeedRequest): Promise<Feed>;
async operationsGet(name: string): Promise<Operation>;
async savedQueriesCreate(
parent: string,
): Promise<SavedQuery>;
async savedQueriesDelete(name: string): Promise<Empty>;
async savedQueriesGet(name: string): Promise<SavedQuery>;
async savedQueriesList(parent: string, opts?: SavedQueriesListOptions): Promise<ListSavedQueriesResponse>;
async savedQueriesPatch(
name: string,
): Promise<SavedQuery>;
async v1AnalyzeIamPolicy(scope: string, opts?: V1AnalyzeIamPolicyOptions): Promise<AnalyzeIamPolicyResponse>;
async v1AnalyzeIamPolicyLongrunning(scope: string, req: AnalyzeIamPolicyLongrunningRequest): Promise<Operation>;
async v1AnalyzeMove(resource: string, opts?: V1AnalyzeMoveOptions): Promise<AnalyzeMoveResponse>;
async v1AnalyzeOrgPolicies(scope: string, opts?: V1AnalyzeOrgPoliciesOptions): Promise<AnalyzeOrgPoliciesResponse>;
async v1AnalyzeOrgPolicyGovernedAssets(scope: string, opts?: V1AnalyzeOrgPolicyGovernedAssetsOptions): Promise<AnalyzeOrgPolicyGovernedAssetsResponse>;
async v1AnalyzeOrgPolicyGovernedContainers(scope: string, opts?: V1AnalyzeOrgPolicyGovernedContainersOptions): Promise<AnalyzeOrgPolicyGovernedContainersResponse>;
async v1BatchGetAssetsHistory(parent: string, opts?: V1BatchGetAssetsHistoryOptions): Promise<BatchGetAssetsHistoryResponse>;
async v1ExportAssets(parent: string, req: ExportAssetsRequest): Promise<Operation>;
async v1QueryAssets(parent: string, req: QueryAssetsRequest): Promise<QueryAssetsResponse>;
async v1SearchAllIamPolicies(scope: string, opts?: V1SearchAllIamPoliciesOptions): Promise<SearchAllIamPoliciesResponse>;
async v1SearchAllResources(scope: string, opts?: V1SearchAllResourcesOptions): Promise<SearchAllResourcesResponse>;
}

§Constructors

§
new CloudAsset(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
assetsList(parent: string, opts?: AssetsListOptions): Promise<ListAssetsResponse>
[src]

Lists assets with time and resource types and returns paged results in response.

@param parent

Required. Name of the organization, folder, or project the assets belong to. Format: "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345").

§
effectiveIamPoliciesBatchGet(scope: string, opts?: EffectiveIamPoliciesBatchGetOptions): Promise<BatchGetEffectiveIamPoliciesResponse>
[src]

Gets effective IAM policies for a batch of resources.

@param scope

Required. Only IAM policies on or below the scope will be returned. This can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). To know how to get organization ID, visit here . To know how to get folder or project ID, visit here .

§
feedsCreate(parent: string, req: CreateFeedRequest): Promise<Feed>
[src]

Creates a feed in a parent project/folder/organization to listen to its asset updates.

@param parent

Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

§
feedsDelete(name: string): Promise<Empty>
[src]

Deletes an asset feed.

@param name

Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

§
feedsGet(name: string): Promise<Feed>
[src]

Gets details about an asset feed.

@param name

Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id

§
feedsList(parent: string): Promise<ListFeedsResponse>
[src]

Lists all asset feeds in a parent project/folder/organization.

@param parent

Required. The parent project/folder/organization whose feeds are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

§
feedsPatch(name: string, req: UpdateFeedRequest): Promise<Feed>
[src]

Updates an asset feed configuration.

@param name

Required. The format will be projects/{project_number}/feeds/{client-assigned_feed_identifier} or folders/{folder_number}/feeds/{client-assigned_feed_identifier} or organizations/{organization_number}/feeds/{client-assigned_feed_identifier} The client-assigned feed identifier must be unique within the parent project/folder/organization.

§
operationsGet(name: string): Promise<Operation>
[src]

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

@param name

The name of the operation resource.

§
savedQueriesCreate(parent: string, req: SavedQuery, opts?: SavedQueriesCreateOptions): Promise<SavedQuery>
[src]

Creates a saved query in a parent project/folder/organization.

@param parent

Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345").

§
savedQueriesDelete(name: string): Promise<Empty>
[src]

Deletes a saved query.

@param name

Required. The name of the saved query to delete. It must be in the format of: * projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * organizations/organization_number/savedQueries/saved_query_id

§
savedQueriesGet(name: string): Promise<SavedQuery>
[src]

Gets details about a saved query.

@param name

Required. The name of the saved query and it must be in the format of: * projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * organizations/organization_number/savedQueries/saved_query_id

§
savedQueriesList(parent: string, opts?: SavedQueriesListOptions): Promise<ListSavedQueriesResponse>
[src]

Lists all saved queries in a parent project/folder/organization.

@param parent

Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using project/folder/organization number (such as "folders/12345")", or a project ID (such as "projects/my-project-id").

§
savedQueriesPatch(name: string, req: SavedQuery, opts?: SavedQueriesPatchOptions): Promise<SavedQuery>
[src]

Updates a saved query.

@param name

The resource name of the saved query. The format must be: * projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * organizations/organization_number/savedQueries/saved_query_id

§
v1AnalyzeIamPolicy(scope: string, opts?: V1AnalyzeIamPolicyOptions): Promise<AnalyzeIamPolicyResponse>
[src]

Analyzes IAM policies to answer which identities have what accesses on which resources.

@param scope

Required. The relative name of the root asset. Only resources and IAM policies within the scope will be analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). To know how to get organization ID, visit here . To know how to get folder or project ID, visit here .

§
v1AnalyzeIamPolicyLongrunning(scope: string, req: AnalyzeIamPolicyLongrunningRequest): Promise<Operation>
[src]

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.

@param scope

Required. The relative name of the root asset. Only resources and IAM policies within the scope will be analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). To know how to get organization ID, visit here . To know how to get folder or project ID, visit here .

§
v1AnalyzeMove(resource: string, opts?: V1AnalyzeMoveOptions): Promise<AnalyzeMoveResponse>
[src]

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.

@param resource

Required. Name of the resource to perform the analysis against. Only Google Cloud projects are supported as of today. Hence, this can only be a project ID (such as "projects/my-project-id") or a project number (such as "projects/12345").

§
v1AnalyzeOrgPolicies(scope: string, opts?: V1AnalyzeOrgPoliciesOptions): Promise<AnalyzeOrgPoliciesResponse>
[src]

Analyzes organization policies under a scope.

@param scope

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")

§
v1AnalyzeOrgPolicyGovernedAssets(scope: string, opts?: V1AnalyzeOrgPolicyGovernedAssetsOptions): Promise<AnalyzeOrgPolicyGovernedAssetsResponse>
[src]

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.
@param scope

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output assets will also be limited to the ones governed by those in-scope organization policies. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")

§
v1AnalyzeOrgPolicyGovernedContainers(scope: string, opts?: V1AnalyzeOrgPolicyGovernedContainersOptions): Promise<AnalyzeOrgPolicyGovernedContainersResponse>
[src]

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

@param scope

Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output containers will also be limited to the ones governed by those in-scope organization policies. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")

§
v1BatchGetAssetsHistory(parent: string, opts?: V1BatchGetAssetsHistoryOptions): Promise<BatchGetAssetsHistoryResponse>
[src]

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.

@param parent

Required. The relative name of the root asset. It can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345").

§
v1ExportAssets(parent: string, req: ExportAssetsRequest): Promise<Operation>
[src]

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.

@param parent

Required. The relative name of the root asset. This can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"), or a folder number (such as "folders/123").

§
v1QueryAssets(parent: string, req: QueryAssetsRequest): Promise<QueryAssetsResponse>
[src]

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.

@param parent

Required. The relative name of the root asset. This can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"), or a folder number (such as "folders/123"). Only assets belonging to the parent will be returned.

§
v1SearchAllIamPolicies(scope: string, opts?: V1SearchAllIamPoliciesOptions): Promise<SearchAllIamPoliciesResponse>
[src]

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.

@param scope

Required. A scope can be a project, a folder, or an organization. The search is limited to the IAM policies within the scope. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")

§
v1SearchAllResources(scope: string, opts?: V1SearchAllResourcesOptions): Promise<SearchAllResourcesResponse>
[src]

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.

@param scope

Required. A scope can be a project, a folder, or an organization. The search is limited to the resources within the scope. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")