asset

package
v0.0.0-...-f9bfe23 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 15 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",
	}
	ContentType_value = map[string]int32{
		"CONTENT_TYPE_UNSPECIFIED": 0,
		"RESOURCE":                 1,
		"IAM_POLICY":               2,
	}
)

Enum value maps for ContentType.

View Source
var File_google_cloud_asset_v1beta1_asset_service_proto protoreflect.FileDescriptor
View Source
var File_google_cloud_asset_v1beta1_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: "google.compute.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"`
	// 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) 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) GetResource

func (x *Asset) GetResource() *Resource

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 {
	// Exports assets with time and resource types to a given Cloud Storage
	// location. The output format is newline-delimited JSON.
	// This API implements the
	// [google.longrunning.Operation][google.longrunning.Operation] API allowing
	// you to keep track of the export.
	ExportAssets(ctx context.Context, in *ExportAssetsRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
	// Batch gets the update history of assets that overlap a time window.
	// For RESOURCE content, this API outputs history with asset in both
	// non-delete or deleted status.
	// 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.
	// If a specified asset does not exist, this API returns an INVALID_ARGUMENT
	// error.
	BatchGetAssetsHistory(ctx context.Context, in *BatchGetAssetsHistoryRequest, opts ...grpc.CallOption) (*BatchGetAssetsHistoryResponse, 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 {
	// Exports assets with time and resource types to a given Cloud Storage
	// location. The output format is newline-delimited JSON.
	// This API implements the
	// [google.longrunning.Operation][google.longrunning.Operation] API allowing
	// you to keep track of the export.
	ExportAssets(context.Context, *ExportAssetsRequest) (*longrunning.Operation, error)
	// Batch gets the update history of assets that overlap a time window.
	// For RESOURCE content, this API outputs history with asset in both
	// non-delete or deleted status.
	// 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.
	// If a specified asset does not exist, this API returns an INVALID_ARGUMENT
	// error.
	BatchGetAssetsHistory(context.Context, *BatchGetAssetsHistoryRequest) (*BatchGetAssetsHistoryResponse, error)
}

AssetServiceServer is the server API for AssetService service.

type BatchGetAssetsHistoryRequest

type BatchGetAssetsHistoryRequest struct {

	// 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").
	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
	// A list of the full names of the assets. 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 info.
	//
	// The request becomes a no-op if the asset name list is empty, and the max
	// size of the asset name list is 100 in one request.
	AssetNames []string `protobuf:"bytes,2,rep,name=asset_names,json=assetNames,proto3" json:"asset_names,omitempty"`
	// Optional. The content type.
	ContentType ContentType `` /* 139-byte string literal not displayed */
	// Optional. The time window for the asset history. Both start_time and
	// end_time are optional and if set, it must be after 2018-10-02 UTC. If
	// end_time is not set, it is default to current timestamp. If start_time is
	// not set, the snapshot of the assets at end_time will be returned. The
	// returned results contain all temporal assets whose time window overlap with
	// read_time_window.
	ReadTimeWindow *TimeWindow `protobuf:"bytes,4,opt,name=read_time_window,json=readTimeWindow,proto3" json:"read_time_window,omitempty"`
	// contains filtered or unexported fields
}

Batch get assets history request.

func (*BatchGetAssetsHistoryRequest) Descriptor deprecated

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

Deprecated: Use BatchGetAssetsHistoryRequest.ProtoReflect.Descriptor instead.

func (*BatchGetAssetsHistoryRequest) GetAssetNames

func (x *BatchGetAssetsHistoryRequest) GetAssetNames() []string

func (*BatchGetAssetsHistoryRequest) GetContentType

func (x *BatchGetAssetsHistoryRequest) GetContentType() ContentType

func (*BatchGetAssetsHistoryRequest) GetParent

func (x *BatchGetAssetsHistoryRequest) GetParent() string

func (*BatchGetAssetsHistoryRequest) GetReadTimeWindow

func (x *BatchGetAssetsHistoryRequest) GetReadTimeWindow() *TimeWindow

func (*BatchGetAssetsHistoryRequest) ProtoMessage

func (*BatchGetAssetsHistoryRequest) ProtoMessage()

func (*BatchGetAssetsHistoryRequest) ProtoReflect

func (*BatchGetAssetsHistoryRequest) Reset

func (x *BatchGetAssetsHistoryRequest) Reset()

func (*BatchGetAssetsHistoryRequest) String

type BatchGetAssetsHistoryResponse

type BatchGetAssetsHistoryResponse struct {

	// A list of assets with valid time windows.
	Assets []*TemporalAsset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"`
	// contains filtered or unexported fields
}

Batch get assets history response.

func (*BatchGetAssetsHistoryResponse) Descriptor deprecated

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

Deprecated: Use BatchGetAssetsHistoryResponse.ProtoReflect.Descriptor instead.

func (*BatchGetAssetsHistoryResponse) GetAssets

func (x *BatchGetAssetsHistoryResponse) GetAssets() []*TemporalAsset

func (*BatchGetAssetsHistoryResponse) ProtoMessage

func (*BatchGetAssetsHistoryResponse) ProtoMessage()

func (*BatchGetAssetsHistoryResponse) ProtoReflect

func (*BatchGetAssetsHistoryResponse) Reset

func (x *BatchGetAssetsHistoryResponse) Reset()

func (*BatchGetAssetsHistoryResponse) String

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
)

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 ExportAssetsRequest

type ExportAssetsRequest struct {

	// 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"), a project number (such as "projects/12345"), or
	// a folder number (such as "folders/123").
	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:
	// "google.compute.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 `` /* 139-byte string literal not displayed */
	// Required. Output configuration indicating where the results will be output
	// to. All results will be in newline delimited JSON format.
	OutputConfig *OutputConfig `protobuf:"bytes,5,opt,name=output_config,json=outputConfig,proto3" json:"output_config,omitempty"`
	// contains filtered or unexported fields
}

Export asset request.

func (*ExportAssetsRequest) Descriptor deprecated

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

Deprecated: Use ExportAssetsRequest.ProtoReflect.Descriptor instead.

func (*ExportAssetsRequest) GetAssetTypes

func (x *ExportAssetsRequest) GetAssetTypes() []string

func (*ExportAssetsRequest) GetContentType

func (x *ExportAssetsRequest) GetContentType() ContentType

func (*ExportAssetsRequest) GetOutputConfig

func (x *ExportAssetsRequest) GetOutputConfig() *OutputConfig

func (*ExportAssetsRequest) GetParent

func (x *ExportAssetsRequest) GetParent() string

func (*ExportAssetsRequest) GetReadTime

func (x *ExportAssetsRequest) GetReadTime() *timestamppb.Timestamp

func (*ExportAssetsRequest) ProtoMessage

func (*ExportAssetsRequest) ProtoMessage()

func (*ExportAssetsRequest) ProtoReflect

func (x *ExportAssetsRequest) ProtoReflect() protoreflect.Message

func (*ExportAssetsRequest) Reset

func (x *ExportAssetsRequest) Reset()

func (*ExportAssetsRequest) String

func (x *ExportAssetsRequest) String() string

type ExportAssetsResponse

type ExportAssetsResponse struct {

	// Time the snapshot was taken.
	ReadTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
	// Output configuration indicating where the results were output to.
	// All results are in JSON format.
	OutputConfig *OutputConfig `protobuf:"bytes,2,opt,name=output_config,json=outputConfig,proto3" json:"output_config,omitempty"`
	// contains filtered or unexported fields
}

The export asset response. This message is returned by the [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned [google.longrunning.Operation.response][google.longrunning.Operation.response] field.

func (*ExportAssetsResponse) Descriptor deprecated

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

Deprecated: Use ExportAssetsResponse.ProtoReflect.Descriptor instead.

func (*ExportAssetsResponse) GetOutputConfig

func (x *ExportAssetsResponse) GetOutputConfig() *OutputConfig

func (*ExportAssetsResponse) GetReadTime

func (x *ExportAssetsResponse) GetReadTime() *timestamppb.Timestamp

func (*ExportAssetsResponse) ProtoMessage

func (*ExportAssetsResponse) ProtoMessage()

func (*ExportAssetsResponse) ProtoReflect

func (x *ExportAssetsResponse) ProtoReflect() protoreflect.Message

func (*ExportAssetsResponse) Reset

func (x *ExportAssetsResponse) Reset()

func (*ExportAssetsResponse) String

func (x *ExportAssetsResponse) String() string

type GcsDestination

type GcsDestination struct {

	// Required.
	//
	// Types that are assignable to ObjectUri:
	//	*GcsDestination_Uri
	//	*GcsDestination_UriPrefix
	ObjectUri isGcsDestination_ObjectUri `protobuf_oneof:"object_uri"`
	// contains filtered or unexported fields
}

A Cloud Storage location.

func (*GcsDestination) Descriptor deprecated

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

Deprecated: Use GcsDestination.ProtoReflect.Descriptor instead.

func (*GcsDestination) GetObjectUri

func (m *GcsDestination) GetObjectUri() isGcsDestination_ObjectUri

func (*GcsDestination) GetUri

func (x *GcsDestination) GetUri() string

func (*GcsDestination) GetUriPrefix

func (x *GcsDestination) GetUriPrefix() string

func (*GcsDestination) ProtoMessage

func (*GcsDestination) ProtoMessage()

func (*GcsDestination) ProtoReflect

func (x *GcsDestination) ProtoReflect() protoreflect.Message

func (*GcsDestination) Reset

func (x *GcsDestination) Reset()

func (*GcsDestination) String

func (x *GcsDestination) String() string

type GcsDestination_Uri

type GcsDestination_Uri struct {
	// The uri of the Cloud Storage object. It's the same uri that is used by
	// gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
	// Editing Object
	// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
	// for more information.
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3,oneof"`
}

type GcsDestination_UriPrefix

type GcsDestination_UriPrefix struct {
	// The uri prefix of all generated Cloud Storage objects. For example:
	// "gs://bucket_name/object_name_prefix". Each object uri is in format:
	// "gs://bucket_name/object_name_prefix/<asset type>/<shard number> and only
	// contains assets for that type. <shard number> starts from 0. For example:
	// "gs://bucket_name/object_name_prefix/google.compute.disk/0" is the first
	// shard of output objects containing all google.compute.disk assets.
	// An INVALID_ARGUMENT error will be returned if file with the same name
	// "gs://bucket_name/object_name_prefix" already exists.
	UriPrefix string `protobuf:"bytes,2,opt,name=uri_prefix,json=uriPrefix,proto3,oneof"`
}

type OutputConfig

type OutputConfig struct {

	// Asset export destination.
	//
	// Types that are assignable to Destination:
	//	*OutputConfig_GcsDestination
	Destination isOutputConfig_Destination `protobuf_oneof:"destination"`
	// contains filtered or unexported fields
}

Output configuration for export assets destination.

func (*OutputConfig) Descriptor deprecated

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

Deprecated: Use OutputConfig.ProtoReflect.Descriptor instead.

func (*OutputConfig) GetDestination

func (m *OutputConfig) GetDestination() isOutputConfig_Destination

func (*OutputConfig) GetGcsDestination

func (x *OutputConfig) GetGcsDestination() *GcsDestination

func (*OutputConfig) ProtoMessage

func (*OutputConfig) ProtoMessage()

func (*OutputConfig) ProtoReflect

func (x *OutputConfig) ProtoReflect() protoreflect.Message

func (*OutputConfig) Reset

func (x *OutputConfig) Reset()

func (*OutputConfig) String

func (x *OutputConfig) String() string

type OutputConfig_GcsDestination

type OutputConfig_GcsDestination struct {
	// Destination on Cloud Storage.
	GcsDestination *GcsDestination `protobuf:"bytes,1,opt,name=gcs_destination,json=gcsDestination,proto3,oneof"`
}

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 TemporalAsset

type TemporalAsset struct {

	// The time window when the asset data and state was observed.
	Window *TimeWindow `protobuf:"bytes,1,opt,name=window,proto3" json:"window,omitempty"`
	// If the asset is deleted or not.
	Deleted bool `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"`
	// Asset.
	Asset *Asset `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"`
	// contains filtered or unexported fields
}

Temporal asset. In addition to the asset, the temporal asset includes the status of the asset and valid from and to time of it.

func (*TemporalAsset) Descriptor deprecated

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

Deprecated: Use TemporalAsset.ProtoReflect.Descriptor instead.

func (*TemporalAsset) GetAsset

func (x *TemporalAsset) GetAsset() *Asset

func (*TemporalAsset) GetDeleted

func (x *TemporalAsset) GetDeleted() bool

func (*TemporalAsset) GetWindow

func (x *TemporalAsset) GetWindow() *TimeWindow

func (*TemporalAsset) ProtoMessage

func (*TemporalAsset) ProtoMessage()

func (*TemporalAsset) ProtoReflect

func (x *TemporalAsset) ProtoReflect() protoreflect.Message

func (*TemporalAsset) Reset

func (x *TemporalAsset) Reset()

func (*TemporalAsset) String

func (x *TemporalAsset) String() string

type TimeWindow

type TimeWindow struct {

	// Start time of the time window (exclusive).
	StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// End time of the time window (inclusive).
	// Current timestamp if not specified.
	EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

A time window of (start_time, end_time].

func (*TimeWindow) Descriptor deprecated

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

Deprecated: Use TimeWindow.ProtoReflect.Descriptor instead.

func (*TimeWindow) GetEndTime

func (x *TimeWindow) GetEndTime() *timestamppb.Timestamp

func (*TimeWindow) GetStartTime

func (x *TimeWindow) GetStartTime() *timestamppb.Timestamp

func (*TimeWindow) ProtoMessage

func (*TimeWindow) ProtoMessage()

func (*TimeWindow) ProtoReflect

func (x *TimeWindow) ProtoReflect() protoreflect.Message

func (*TimeWindow) Reset

func (x *TimeWindow) Reset()

func (*TimeWindow) String

func (x *TimeWindow) String() string

type UnimplementedAssetServiceServer

type UnimplementedAssetServiceServer struct {
}

UnimplementedAssetServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAssetServiceServer) ExportAssets

Jump to

Keyboard shortcuts

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