Reference documentation and code samples for the Google Cloud Asset V1 Client class Asset.
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. Cloud IAM policy), or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship).
See Supported asset types for more information.
Generated from protobuf message google.cloud.asset.v1.Asset
Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ update_time |
Google\Protobuf\Timestamp
The last update timestamp of an asset. update_time is updated when create/update/delete operation is performed. |
↳ name |
string
The full name of the asset. Example: |
↳ asset_type |
string
The type of the asset. Example: |
↳ resource |
Google\Cloud\Asset\V1\Resource
A representation of the resource. |
↳ iam_policy |
Google\Cloud\Iam\V1\Policy
A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud 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. |
↳ org_policy |
array<Google\Cloud\OrgPolicy\V1\Policy>
A representation of an organization policy. There can be more than one organization policy with different constraints set on a given resource. |
↳ access_policy |
Google\Identity\AccessContextManager\V1\AccessPolicy
Please also refer to the access policy user guide. |
↳ access_level |
Google\Identity\AccessContextManager\V1\AccessLevel
Please also refer to the access level user guide. |
↳ service_perimeter |
Google\Identity\AccessContextManager\V1\ServicePerimeter
Please also refer to the service perimeter user guide. |
↳ os_inventory |
Google\Cloud\OsConfig\V1\Inventory
A representation of runtime OS Inventory information. See this topic for more information. |
↳ related_assets |
Google\Cloud\Asset\V1\RelatedAssets
DEPRECATED. This field only presents for the purpose of backward-compatibility. The server will never generate responses with this field. The related assets of the asset of one relationship type. One asset only represents one type of relationship. |
↳ related_asset |
Google\Cloud\Asset\V1\RelatedAsset
One related asset of the current asset. |
↳ ancestors |
array
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: |
getUpdateTime
The last update timestamp of an asset. update_time is updated when create/update/delete operation is performed.
Generated from protobuf field .google.protobuf.Timestamp update_time = 11;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasUpdateTime
clearUpdateTime
setUpdateTime
The last update timestamp of an asset. update_time is updated when create/update/delete operation is performed.
Generated from protobuf field .google.protobuf.Timestamp update_time = 11;
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getName
The full name of the asset. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
Generated from protobuf field string name = 1;
Returns | |
---|---|
Type | Description |
string |
setName
The full name of the asset. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
Generated from protobuf field string name = 1;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getAssetType
The type of the asset. Example: compute.googleapis.com/Disk
See Supported asset
types
for more information.
Generated from protobuf field string asset_type = 2;
Returns | |
---|---|
Type | Description |
string |
setAssetType
The type of the asset. Example: compute.googleapis.com/Disk
See Supported asset
types
for more information.
Generated from protobuf field string asset_type = 2;
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getResource
A representation of the resource.
Generated from protobuf field .google.cloud.asset.v1.Resource resource = 3;
Returns | |
---|---|
Type | Description |
Google\Cloud\Asset\V1\Resource|null |
hasResource
clearResource
setResource
A representation of the resource.
Generated from protobuf field .google.cloud.asset.v1.Resource resource = 3;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Asset\V1\Resource
|
Returns | |
---|---|
Type | Description |
$this |
getIamPolicy
A representation of the Cloud IAM policy set on a Google Cloud resource.
There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud 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.
Generated from protobuf field .google.iam.v1.Policy iam_policy = 4;
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy|null |
hasIamPolicy
clearIamPolicy
setIamPolicy
A representation of the Cloud IAM policy set on a Google Cloud resource.
There can be a maximum of one Cloud IAM policy set on any given resource. In addition, Cloud 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.
Generated from protobuf field .google.iam.v1.Policy iam_policy = 4;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Iam\V1\Policy
|
Returns | |
---|---|
Type | Description |
$this |
getOrgPolicy
A representation of an organization policy.
There can be more than one organization policy with different constraints set on a given resource.
Generated from protobuf field repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setOrgPolicy
A representation of an organization policy.
There can be more than one organization policy with different constraints set on a given resource.
Generated from protobuf field repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6;
Parameter | |
---|---|
Name | Description |
var |
array<Google\Cloud\OrgPolicy\V1\Policy>
|
Returns | |
---|---|
Type | Description |
$this |
getAccessPolicy
Please also refer to the access policy user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
Returns | |
---|---|
Type | Description |
Google\Identity\AccessContextManager\V1\AccessPolicy|null |
hasAccessPolicy
setAccessPolicy
Please also refer to the access policy user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
Parameter | |
---|---|
Name | Description |
var |
Google\Identity\AccessContextManager\V1\AccessPolicy
|
Returns | |
---|---|
Type | Description |
$this |
getAccessLevel
Please also refer to the access level user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
Returns | |
---|---|
Type | Description |
Google\Identity\AccessContextManager\V1\AccessLevel|null |
hasAccessLevel
setAccessLevel
Please also refer to the access level user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
Parameter | |
---|---|
Name | Description |
var |
Google\Identity\AccessContextManager\V1\AccessLevel
|
Returns | |
---|---|
Type | Description |
$this |
getServicePerimeter
Please also refer to the service perimeter user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
Returns | |
---|---|
Type | Description |
Google\Identity\AccessContextManager\V1\ServicePerimeter|null |
hasServicePerimeter
setServicePerimeter
Please also refer to the service perimeter user guide.
Generated from protobuf field .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
Parameter | |
---|---|
Name | Description |
var |
Google\Identity\AccessContextManager\V1\ServicePerimeter
|
Returns | |
---|---|
Type | Description |
$this |
getOsInventory
A representation of runtime OS Inventory information. See this topic for more information.
Generated from protobuf field .google.cloud.osconfig.v1.Inventory os_inventory = 12;
Returns | |
---|---|
Type | Description |
Google\Cloud\OsConfig\V1\Inventory|null |
hasOsInventory
clearOsInventory
setOsInventory
A representation of runtime OS Inventory information. See this topic for more information.
Generated from protobuf field .google.cloud.osconfig.v1.Inventory os_inventory = 12;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\OsConfig\V1\Inventory
|
Returns | |
---|---|
Type | Description |
$this |
getRelatedAssets
DEPRECATED. This field only presents for the purpose of backward-compatibility. The server will never generate responses with this field.
The related assets of the asset of one relationship type. One asset only represents one type of relationship.
Generated from protobuf field .google.cloud.asset.v1.RelatedAssets related_assets = 13 [deprecated = true];
Returns | |
---|---|
Type | Description |
Google\Cloud\Asset\V1\RelatedAssets|null |
hasRelatedAssets
clearRelatedAssets
setRelatedAssets
DEPRECATED. This field only presents for the purpose of backward-compatibility. The server will never generate responses with this field.
The related assets of the asset of one relationship type. One asset only represents one type of relationship.
Generated from protobuf field .google.cloud.asset.v1.RelatedAssets related_assets = 13 [deprecated = true];
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Asset\V1\RelatedAssets
|
Returns | |
---|---|
Type | Description |
$this |
getRelatedAsset
One related asset of the current asset.
Generated from protobuf field .google.cloud.asset.v1.RelatedAsset related_asset = 15;
Returns | |
---|---|
Type | Description |
Google\Cloud\Asset\V1\RelatedAsset|null |
hasRelatedAsset
clearRelatedAsset
setRelatedAsset
One related asset of the current asset.
Generated from protobuf field .google.cloud.asset.v1.RelatedAsset related_asset = 15;
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Asset\V1\RelatedAsset
|
Returns | |
---|---|
Type | Description |
$this |
getAncestors
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"]
Generated from protobuf field repeated string ancestors = 10;
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setAncestors
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"]
Generated from protobuf field repeated string ancestors = 10;
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getAccessContextPolicy
Returns | |
---|---|
Type | Description |
string |