asset

package
v0.0.0-...-6cb3ea0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_google_cloud_asset_v1p5beta1_asset_service_proto protoreflect.FileDescriptor
View Source
var File_google_cloud_asset_v1p5beta1_assets_proto protoreflect.FileDescriptor

Functions

func RegisterAssetServiceServer

func RegisterAssetServiceServer(s *grpc.Server, srv AssetServiceServer)

Types

type Asset

type Asset struct {

	// The full name of the asset. For 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"`
	// Type of the asset. Example: "compute.googleapis.com/Disk".
	AssetType string `protobuf:"bytes,2,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"`
	// Representation of the resource.
	Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	// Representation of the actual Cloud IAM policy set on a cloud resource. For
	// each resource, there must be at most one Cloud IAM policy set on it.
	IamPolicy *v1.Policy `protobuf:"bytes,4,opt,name=iam_policy,json=iamPolicy,proto3" json:"iam_policy,omitempty"`
	// Representation of the Cloud Organization Policy set on an asset. For each
	// asset, there could be multiple Organization policies with different
	// constraints.
	OrgPolicy []*v11.Policy `protobuf:"bytes,6,rep,name=org_policy,json=orgPolicy,proto3" json:"org_policy,omitempty"`
	// Representation of the Cloud Organization access policy.
	//
	// Types that are assignable to AccessContextPolicy:
	//	*Asset_AccessPolicy
	//	*Asset_AccessLevel
	//	*Asset_ServicePerimeter
	AccessContextPolicy isAsset_AccessContextPolicy `protobuf_oneof:"access_context_policy"`
	// Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
	// represented as a list of relative resource names. Ancestry path starts with
	// the closest CRM ancestor and ends at root. If the asset is a CRM
	// project/folder/organization, this 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
}

Cloud asset. This includes all Google Cloud Platform resources, Cloud IAM policies, and other non-GCP assets.

func (*Asset) Descriptor deprecated

func (*Asset) Descriptor() ([]byte, []int)

Deprecated: Use Asset.ProtoReflect.Descriptor instead.

func (*Asset) GetAccessContextPolicy

func (m *Asset) GetAccessContextPolicy() isAsset_AccessContextPolicy

func (*Asset) GetAccessLevel

func (x *Asset) GetAccessLevel() *v12.AccessLevel

func (*Asset) GetAccessPolicy

func (x *Asset) GetAccessPolicy() *v12.AccessPolicy

func (*Asset) GetAncestors

func (x *Asset) GetAncestors() []string

func (*Asset) GetAssetType

func (x *Asset) GetAssetType() string

func (*Asset) GetIamPolicy

func (x *Asset) GetIamPolicy() *v1.Policy

func (*Asset) GetName

func (x *Asset) GetName() string

func (*Asset) GetOrgPolicy

func (x *Asset) GetOrgPolicy() []*v11.Policy

func (*Asset) GetResource

func (x *Asset) GetResource() *Resource

func (*Asset) GetServicePerimeter

func (x *Asset) GetServicePerimeter() *v12.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

func (x *Asset) String() string

type 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.

type 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.

type Asset_AccessLevel

type Asset_AccessLevel struct {
	AccessLevel *v12.AccessLevel `protobuf:"bytes,8,opt,name=access_level,json=accessLevel,proto3,oneof"`
}

type Asset_AccessPolicy

type Asset_AccessPolicy struct {
	AccessPolicy *v12.AccessPolicy `protobuf:"bytes,7,opt,name=access_policy,json=accessPolicy,proto3,oneof"`
}

type Asset_ServicePerimeter

type Asset_ServicePerimeter struct {
	ServicePerimeter *v12.ServicePerimeter `protobuf:"bytes,9,opt,name=service_perimeter,json=servicePerimeter,proto3,oneof"`
}

type ContentType

type ContentType int32

Asset content type.

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 Cloud Organization Policy set on an asset.
	ContentType_ORG_POLICY ContentType = 4
	// The Cloud Access context mananger Policy set on an asset.
	ContentType_ACCESS_POLICY ContentType = 5
)

func (ContentType) Descriptor

func (ContentType) Enum

func (x ContentType) Enum() *ContentType

func (ContentType) EnumDescriptor deprecated

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

type 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-number]" (such as "projects/my-project-id"), or
	// "projects/[project-id]" (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 2018-10-02 UTC (inclusive) and the current time. 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 of which to take a snapshot for. For  example:
	// "compute.googleapis.com/Disk". If specified, only matching assets will be
	// returned. See [Introduction to Cloud Asset
	// Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 `` /* 141-byte string literal not displayed */
	// 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 deprecated

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

type 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. 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 deprecated

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

type 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.
	// For example:
	// `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
	// It will be left unspecified for resources without a discovery-based API,
	// 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". It will be left unspecified for resources (such as
	// Cloud Bigtable) without a discovery-based API.
	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 operation using this
	// URL returns the resource itself.
	// Example:
	// `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
	// It will be left 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
	// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
	// For example:
	// `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
	//
	// For third-party assets, it is up to the users to define.
	Parent string `protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty"`
	// The content of the resource, in which some sensitive fields are scrubbed
	// away and may not be present.
	Data *structpb.Struct `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

Representation of a cloud resource.

func (*Resource) Descriptor deprecated

func (*Resource) Descriptor() ([]byte, []int)

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) GetData

func (x *Resource) GetData() *structpb.Struct

func (*Resource) GetDiscoveryDocumentUri

func (x *Resource) GetDiscoveryDocumentUri() string

func (*Resource) GetDiscoveryName

func (x *Resource) GetDiscoveryName() string

func (*Resource) GetParent

func (x *Resource) GetParent() string

func (*Resource) GetResourceUrl

func (x *Resource) GetResourceUrl() string

func (*Resource) GetVersion

func (x *Resource) GetVersion() string

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

func (x *Resource) String() string

type UnimplementedAssetServiceServer

type UnimplementedAssetServiceServer struct {
}

UnimplementedAssetServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAssetServiceServer) ListAssets

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL