Variables
ContentType_name, ContentType_value
var
(
ContentType_name
=
map
[
int32
]
string
{
0
:
"CONTENT_TYPE_UNSPECIFIED"
,
1
:
"RESOURCE"
,
2
:
"IAM_POLICY"
,
4
:
"ORG_POLICY"
,
5
:
"ACCESS_POLICY"
,
}
ContentType_value
=
map
[
string
]
int32
{
"CONTENT_TYPE_UNSPECIFIED"
:
0
,
"RESOURCE"
:
1
,
"IAM_POLICY"
:
2
,
"ORG_POLICY"
:
4
,
"ACCESS_POLICY"
:
5
,
}
)
Enum value maps for ContentType.
File_google_cloud_asset_v1p5beta1_asset_service_proto
var
File_google_cloud_asset_v1p5beta1_asset_service_proto
protoreflect
.
FileDescriptor
File_google_cloud_asset_v1p5beta1_assets_proto
var
File_google_cloud_asset_v1p5beta1_assets_proto
protoreflect
.
FileDescriptor
Functions
func RegisterAssetServiceServer
func
RegisterAssetServiceServer
(
s
*
grpc
.
Server
,
srv
AssetServiceServer
)
Asset
type
Asset
struct
{
// The full name of the asset. Example:
// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
//
// See [Resource
// names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
// for more information.
Name
string
`protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The type of the asset. Example: `compute.googleapis.com/Disk`
//
// See [Supported asset
// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
// for more information.
AssetType
string
`protobuf:"bytes,2,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"`
// A representation of the resource.
Resource
*
Resource
`protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
// 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](https://cloud.google.com/iam/help/allow-policies/inheritance)
// for more information.
IamPolicy
*
iampb
.
Policy
`protobuf:"bytes,4,opt,name=iam_policy,json=iamPolicy,proto3" json:"iam_policy,omitempty"`
// A representation of an [organization
// policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
// There can be more than one organization policy with different constraints
// set on a given resource.
OrgPolicy
[]
*
orgpolicypb
.
Policy
`protobuf:"bytes,6,rep,name=org_policy,json=orgPolicy,proto3" json:"org_policy,omitempty"`
// A representation of an [access
// policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
//
// Types that are assignable to AccessContextPolicy:
//
// *Asset_AccessPolicy
// *Asset_AccessLevel
// *Asset_ServicePerimeter
AccessContextPolicy
isAsset_AccessContextPolicy
`protobuf_oneof:"access_context_policy"`
// The ancestry path of an asset in Google Cloud [resource
// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-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"]`
Ancestors
[]
string
`protobuf:"bytes,10,rep,name=ancestors,proto3" json:"ancestors,omitempty"`
// contains filtered or unexported fields
}
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.
func (*Asset) Descriptor
Deprecated: Use Asset.ProtoReflect.Descriptor instead.
func (*Asset) GetAccessContextPolicy
func
(
m
*
Asset
)
GetAccessContextPolicy
()
isAsset_AccessContextPolicy
func (*Asset) GetAccessLevel
func
(
x
*
Asset
)
GetAccessLevel
()
*
accesscontextmanagerpb
.
AccessLevel
func (*Asset) GetAccessPolicy
func
(
x
*
Asset
)
GetAccessPolicy
()
*
accesscontextmanagerpb
.
AccessPolicy
func (*Asset) GetAncestors
func (*Asset) GetAssetType
func (*Asset) GetIamPolicy
func (*Asset) GetName
func (*Asset) GetOrgPolicy
func
(
x
*
Asset
)
GetOrgPolicy
()
[]
*
orgpolicypb
.
Policy
func (*Asset) GetResource
func (*Asset) GetServicePerimeter
func
(
x
*
Asset
)
GetServicePerimeter
()
*
accesscontextmanagerpb
.
ServicePerimeter
func (*Asset) ProtoMessage
func
(
*
Asset
)
ProtoMessage
()
func (*Asset) ProtoReflect
func
(
x
*
Asset
)
ProtoReflect
()
protoreflect
.
Message
func (*Asset) Reset
func
(
x
*
Asset
)
Reset
()
func (*Asset) String
AssetServiceClient
type
AssetServiceClient
interface
{
// Lists assets with time and resource types and returns paged results in
// response.
ListAssets
(
ctx
context
.
Context
,
in
*
ListAssetsRequest
,
opts
...
grpc
.
CallOption
)
(
*
ListAssetsResponse
,
error
)
}
AssetServiceClient is the client API for AssetService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream .
func NewAssetServiceClient
func
NewAssetServiceClient
(
cc
grpc
.
ClientConnInterface
)
AssetServiceClient
AssetServiceServer
type
AssetServiceServer
interface
{
// Lists assets with time and resource types and returns paged results in
// response.
ListAssets
(
context
.
Context
,
*
ListAssetsRequest
)
(
*
ListAssetsResponse
,
error
)
}
AssetServiceServer is the server API for AssetService service.
Asset_AccessLevel
type
Asset_AccessLevel
struct
{
// Please also refer to the [access level user
// guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
AccessLevel
*
accesscontextmanagerpb
.
AccessLevel
`protobuf:"bytes,8,opt,name=access_level,json=accessLevel,proto3,oneof"`
}
Asset_AccessPolicy
type
Asset_AccessPolicy
struct
{
// Please also refer to the [access policy user
// guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
AccessPolicy
*
accesscontextmanagerpb
.
AccessPolicy
`protobuf:"bytes,7,opt,name=access_policy,json=accessPolicy,proto3,oneof"`
}
Asset_ServicePerimeter
type
Asset_ServicePerimeter
struct
{
// Please also refer to the [service perimeter user
// guide](https://cloud.google.com/vpc-service-controls/docs/overview).
ServicePerimeter
*
accesscontextmanagerpb
.
ServicePerimeter
`protobuf:"bytes,9,opt,name=service_perimeter,json=servicePerimeter,proto3,oneof"`
}
ContentType
type
ContentType
int32
Asset content type.
ContentType_CONTENT_TYPE_UNSPECIFIED, ContentType_RESOURCE, ContentType_IAM_POLICY, ContentType_ORG_POLICY, ContentType_ACCESS_POLICY
const
(
// Unspecified content type.
ContentType_CONTENT_TYPE_UNSPECIFIED
ContentType
=
0
// Resource metadata.
ContentType_RESOURCE
ContentType
=
1
// The actual IAM policy set on a resource.
ContentType_IAM_POLICY
ContentType
=
2
// The organization policy set on an asset.
ContentType_ORG_POLICY
ContentType
=
4
// The Access Context Manager policy set on an asset.
ContentType_ACCESS_POLICY
ContentType
=
5
)
func (ContentType) Descriptor
func
(
ContentType
)
Descriptor
()
protoreflect
.
EnumDescriptor
func (ContentType) Enum
func
(
x
ContentType
)
Enum
()
*
ContentType
func (ContentType) EnumDescriptor
func
(
ContentType
)
EnumDescriptor
()
([]
byte
,
[]
int
)
Deprecated: Use ContentType.Descriptor instead.
func (ContentType) Number
func
(
x
ContentType
)
Number
()
protoreflect
.
EnumNumber
func (ContentType) String
func
(
x
ContentType
)
String
()
string
func (ContentType) Type
func
(
ContentType
)
Type
()
protoreflect
.
EnumType
ListAssetsRequest
type
ListAssetsRequest
struct
{
// 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").
Parent
string
`protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// 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.
ReadTime
*
timestamppb
.
Timestamp
`protobuf:"bytes,2,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
// 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](https://github.com/google/re2/wiki/Syntax) 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](https://cloud.google.com/asset-inventory/docs/overview)
// for all supported asset types.
AssetTypes
[]
string
`protobuf:"bytes,3,rep,name=asset_types,json=assetTypes,proto3" json:"asset_types,omitempty"`
// Asset content type. If not specified, no content but the asset name will
// be returned.
ContentType
ContentType
`protobuf:"varint,4,opt,name=content_type,json=contentType,proto3,enum=google.cloud.asset.v1p5beta1.ContentType" json:"content_type,omitempty"`
// The maximum number of assets to be returned in a single response. Default
// is 100, minimum is 1, and maximum is 1000.
PageSize
int32
`protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// 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.
PageToken
string
`protobuf:"bytes,6,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
ListAssets request.
func (*ListAssetsRequest) Descriptor
func
(
*
ListAssetsRequest
)
Descriptor
()
([]
byte
,
[]
int
)
Deprecated: Use ListAssetsRequest.ProtoReflect.Descriptor instead.
func (*ListAssetsRequest) GetAssetTypes
func
(
x
*
ListAssetsRequest
)
GetAssetTypes
()
[]
string
func (*ListAssetsRequest) GetContentType
func
(
x
*
ListAssetsRequest
)
GetContentType
()
ContentType
func (*ListAssetsRequest) GetPageSize
func
(
x
*
ListAssetsRequest
)
GetPageSize
()
int32
func (*ListAssetsRequest) GetPageToken
func
(
x
*
ListAssetsRequest
)
GetPageToken
()
string
func (*ListAssetsRequest) GetParent
func
(
x
*
ListAssetsRequest
)
GetParent
()
string
func (*ListAssetsRequest) GetReadTime
func
(
x
*
ListAssetsRequest
)
GetReadTime
()
*
timestamppb
.
Timestamp
func (*ListAssetsRequest) ProtoMessage
func
(
*
ListAssetsRequest
)
ProtoMessage
()
func (*ListAssetsRequest) ProtoReflect
func
(
x
*
ListAssetsRequest
)
ProtoReflect
()
protoreflect
.
Message
func (*ListAssetsRequest) Reset
func
(
x
*
ListAssetsRequest
)
Reset
()
func (*ListAssetsRequest) String
func
(
x
*
ListAssetsRequest
)
String
()
string
ListAssetsResponse
type
ListAssetsResponse
struct
{
// Time the snapshot was taken.
ReadTime
*
timestamppb
.
Timestamp
`protobuf:"bytes,1,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
// Assets.
Assets
[]
*
Asset
`protobuf:"bytes,2,rep,name=assets,proto3" json:"assets,omitempty"`
// 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.
NextPageToken
string
`protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
ListAssets response.
func (*ListAssetsResponse) Descriptor
func
(
*
ListAssetsResponse
)
Descriptor
()
([]
byte
,
[]
int
)
Deprecated: Use ListAssetsResponse.ProtoReflect.Descriptor instead.
func (*ListAssetsResponse) GetAssets
func
(
x
*
ListAssetsResponse
)
GetAssets
()
[]
*
Asset
func (*ListAssetsResponse) GetNextPageToken
func
(
x
*
ListAssetsResponse
)
GetNextPageToken
()
string
func (*ListAssetsResponse) GetReadTime
func
(
x
*
ListAssetsResponse
)
GetReadTime
()
*
timestamppb
.
Timestamp
func (*ListAssetsResponse) ProtoMessage
func
(
*
ListAssetsResponse
)
ProtoMessage
()
func (*ListAssetsResponse) ProtoReflect
func
(
x
*
ListAssetsResponse
)
ProtoReflect
()
protoreflect
.
Message
func (*ListAssetsResponse) Reset
func
(
x
*
ListAssetsResponse
)
Reset
()
func (*ListAssetsResponse) String
func
(
x
*
ListAssetsResponse
)
String
()
string
Resource
type
Resource
struct
{
// The API version. Example: "v1".
Version
string
`protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
// 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.
DiscoveryDocumentUri
string
`protobuf:"bytes,2,opt,name=discovery_document_uri,json=discoveryDocumentUri,proto3" json:"discovery_document_uri,omitempty"`
// 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.
DiscoveryName
string
`protobuf:"bytes,3,opt,name=discovery_name,json=discoveryName,proto3" json:"discovery_name,omitempty"`
// 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.
ResourceUrl
string
`protobuf:"bytes,4,opt,name=resource_url,json=resourceUrl,proto3" json:"resource_url,omitempty"`
// The full name of the immediate parent of this resource. See
// [Resource
// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
// for more information.
//
// For Google Cloud assets, this value is the parent resource defined in the
// [IAM policy
// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
// Example:
// `//cloudresourcemanager.googleapis.com/projects/my_project_123`
//
// For third-party assets, this field may be set differently.
Parent
string
`protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty"`
// The content of the resource, in which some sensitive fields are removed
// and may not be present.
Data
*
structpb
.
Struct
`protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
A representation of a Google Cloud resource.
func (*Resource) Descriptor
Deprecated: Use Resource.ProtoReflect.Descriptor instead.
func (*Resource) GetData
func (*Resource) GetDiscoveryDocumentUri
func (*Resource) GetDiscoveryName
func (*Resource) GetParent
func (*Resource) GetResourceUrl
func (*Resource) GetVersion
func (*Resource) ProtoMessage
func
(
*
Resource
)
ProtoMessage
()
func (*Resource) ProtoReflect
func
(
x
*
Resource
)
ProtoReflect
()
protoreflect
.
Message
func (*Resource) Reset
func
(
x
*
Resource
)
Reset
()
func (*Resource) String
UnimplementedAssetServiceServer
type
UnimplementedAssetServiceServer
struct
{
}
UnimplementedAssetServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedAssetServiceServer) ListAssets
func
(
*
UnimplementedAssetServiceServer
)
ListAssets
(
context
.
Context
,
*
ListAssetsRequest
)
(
*
ListAssetsResponse
,
error
)