As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Asset v1p5beta1 API

class google.cloud.asset_v1p5beta1.types.Asset(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An asset in Google Cloud. An asset can be any resource in the Google Cloud resource hierarchy, a resource outside the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). See Supported asset types for more information.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

name

The full name of the asset. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1

See Resource names for more information.

Type

str

asset_type

The type of the asset. Example: compute.googleapis.com/Disk

See Supported asset types for more information.

Type

str

resource

A representation of the resource.

Type

google.cloud.asset_v1p5beta1.types.Resource

iam_policy

A representation of the IAM policy set on a Google Cloud resource. There can be a maximum of one IAM policy set on any given resource. In addition, IAM policies inherit their granted access scope from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is the union of both the policy set on this resource and each policy set on all of the resource’s ancestry resource levels in the hierarchy. See this topic for more information.

Type

google.iam.v1.policy_pb2.Policy

org_policy

A representation of an organization policy. There can be more than one organization policy with different constraints set on a given resource.

Type

MutableSequence[google.cloud.orgpolicy.v1.orgpolicy_pb2.Policy]

access_policy

Please also refer to the access policy user guide.

This field is a member of oneof access_context_policy.

Type

google.identity.accesscontextmanager.v1.access_policy_pb2.AccessPolicy

access_level

Please also refer to the access level user guide.

This field is a member of oneof access_context_policy.

Type

google.identity.accesscontextmanager.v1.access_level_pb2.AccessLevel

service_perimeter

Please also refer to the service perimeter user guide.

This field is a member of oneof access_context_policy.

Type

google.identity.accesscontextmanager.v1.service_perimeter_pb2.ServicePerimeter

ancestors

The ancestry path of an asset in Google Cloud resource hierarchy, represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root. If the asset is a project, folder, or organization, the ancestry path starts from the asset itself.

Example: ["projects/123456789", "folders/5432", "organizations/1234"]

Type

MutableSequence[str]

class google.cloud.asset_v1p5beta1.types.ContentType(value)[source]

Bases: proto.enums.Enum

Asset content type.

Values:
CONTENT_TYPE_UNSPECIFIED (0):

Unspecified content type.

RESOURCE (1):

Resource metadata.

IAM_POLICY (2):

The actual IAM policy set on a resource.

ORG_POLICY (4):

The organization policy set on an asset.

ACCESS_POLICY (5):

The Access Context Manager policy set on an asset.

class google.cloud.asset_v1p5beta1.types.ListAssetsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ListAssets request.

parent

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

Type

str

read_time

Timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and the current time minus 35 days (inclusive). If not specified, the current time will be used. Due to delays in resource data collection and indexing, there is a volatile window during which running the same query may get different results.

Type

google.protobuf.timestamp_pb2.Timestamp

asset_types

A list of asset types to take a snapshot for. For example: “compute.googleapis.com/Disk”.

Regular expression is also supported. For example:

  • “compute.googleapis.com.*” snapshots resources whose asset type starts with “compute.googleapis.com”.

  • “.*Instance” snapshots resources whose asset type ends with “Instance”.

  • “.*Instance.*” snapshots resources whose asset type contains “Instance”.

See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned.

If specified, only matching assets will be returned, otherwise, it will snapshot all asset types. See Introduction to Cloud Asset Inventory for all supported asset types.

Type

MutableSequence[str]

content_type

Asset content type. If not specified, no content but the asset name will be returned.

Type

google.cloud.asset_v1p5beta1.types.ContentType

page_size

The maximum number of assets to be returned in a single response. Default is 100, minimum is 1, and maximum is 1000.

Type

int

page_token

The next_page_token returned from the previous ListAssetsResponse, or unspecified for the first ListAssetsRequest. It is a continuation of a prior ListAssets call, and the API should return the next page of assets.

Type

str

class google.cloud.asset_v1p5beta1.types.ListAssetsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ListAssets response.

read_time

Time the snapshot was taken.

Type

google.protobuf.timestamp_pb2.Timestamp

assets

Assets.

Type

MutableSequence[google.cloud.asset_v1p5beta1.types.Asset]

next_page_token

Token to retrieve the next page of results. It expires 72 hours after the page token for the first page is generated. Set to empty if there are no remaining results.

Type

str

class google.cloud.asset_v1p5beta1.types.Resource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A representation of a Google Cloud resource.

version

The API version. Example: “v1”.

Type

str

discovery_document_uri

The URL of the discovery document containing the resource’s JSON schema. Example: https://www.googleapis.com/discovery/v1/apis/compute/v1/rest

This value is unspecified for resources that do not have an API based on a discovery document, such as Cloud Bigtable.

Type

str

discovery_name

The JSON schema name listed in the discovery document. Example: Project

This value is unspecified for resources that do not have an API based on a discovery document, such as Cloud Bigtable.

Type

str

resource_url

The REST URL for accessing the resource. An HTTP GET request using this URL returns the resource itself. Example: https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123

This value is unspecified for resources without a REST API.

Type

str

parent

The full name of the immediate parent of this resource. See Resource Names for more information.

For Google Cloud assets, this value is the parent resource defined in the IAM policy hierarchy. Example: //cloudresourcemanager.googleapis.com/projects/my_project_123

For third-party assets, this field may be set differently.

Type

str

data

The content of the resource, in which some sensitive fields are removed and may not be present.

Type

google.protobuf.struct_pb2.Struct