1- // Copyright 2018 Google LLC.
1+ // Copyright 2019 Google LLC.
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@ syntax = "proto3";
1818package google.cloud.asset.v1beta1 ;
1919
2020import "google/api/annotations.proto" ;
21+ import "google/api/client.proto" ;
22+ import "google/api/field_behavior.proto" ;
23+ import "google/api/resource.proto" ;
2124import "google/cloud/asset/v1beta1/assets.proto" ;
2225import "google/longrunning/operations.proto" ;
2326import "google/protobuf/timestamp.proto" ;
@@ -31,6 +34,10 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1";
3134
3235// Asset service definition.
3336service AssetService {
37+ option (google.api.default_host ) = "cloudasset.googleapis.com" ;
38+ option (google.api.oauth_scopes ) =
39+ "https://www.googleapis.com/auth/cloud-platform" ;
40+
3441 // Exports assets with time and resource types to a given Cloud Storage
3542 // location. The output format is newline-delimited JSON.
3643 // This API implements the
@@ -49,13 +56,19 @@ service AssetService {
4956 body : "*"
5057 }
5158 };
59+ option (google.longrunning.operation_info ) = {
60+ response_type : "google.cloud.asset.v1beta1.ExportAssetsResponse"
61+ metadata_type : "google.cloud.asset.v1beta1.ExportAssetsRequest"
62+ };
5263 }
5364
5465 // Batch gets the update history of assets that overlap a time window.
5566 // For RESOURCE content, this API outputs history with asset in both
5667 // non-delete or deleted status.
5768 // For IAM_POLICY content, this API outputs history when the asset and its
5869 // attached IAM POLICY both exist. This can create gaps in the output history.
70+ // If a specified asset does not exist, this API returns an INVALID_ARGUMENT
71+ // error.
5972 rpc BatchGetAssetsHistory (BatchGetAssetsHistoryRequest )
6073 returns (BatchGetAssetsHistoryResponse ) {
6174 option (google.api.http ) = {
@@ -73,7 +86,12 @@ message ExportAssetsRequest {
7386 // organization number (such as "organizations/123"), a project ID (such as
7487 // "projects/my-project-id"), a project number (such as "projects/12345"), or
7588 // a folder number (such as "folders/123").
76- string parent = 1 ;
89+ string parent = 1 [
90+ (google.api.field_behavior ) = REQUIRED ,
91+ (google.api.resource_reference ) = {
92+ child_type : "cloudasset.googleapis.com/Asset"
93+ }
94+ ];
7795
7896 // Timestamp to take an asset snapshot. This can only be set to a timestamp
7997 // between 2018-10-02 UTC (inclusive) and the current time. If not specified,
@@ -95,7 +113,7 @@ message ExportAssetsRequest {
95113
96114 // Required. Output configuration indicating where the results will be output
97115 // to. All results will be in newline delimited JSON format.
98- OutputConfig output_config = 5 ;
116+ OutputConfig output_config = 5 [ (google.api .field_behavior ) = REQUIRED ] ;
99117}
100118
101119// The export asset response. This message is returned by the
@@ -117,7 +135,12 @@ message BatchGetAssetsHistoryRequest {
117135 // Required. The relative name of the root asset. It can only be an
118136 // organization number (such as "organizations/123"), a project ID (such as
119137 // "projects/my-project-id")", or a project number (such as "projects/12345").
120- string parent = 1 ;
138+ string parent = 1 [
139+ (google.api.field_behavior ) = REQUIRED ,
140+ (google.api.resource_reference ) = {
141+ child_type : "cloudasset.googleapis.com/Asset"
142+ }
143+ ];
121144
122145 // A list of the full names of the assets. For example:
123146 // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
@@ -129,16 +152,16 @@ message BatchGetAssetsHistoryRequest {
129152 // size of the asset name list is 100 in one request.
130153 repeated string asset_names = 2 ;
131154
132- // Required . The content type.
133- ContentType content_type = 3 ;
155+ // Optional . The content type.
156+ ContentType content_type = 3 [ (google.api .field_behavior ) = OPTIONAL ] ;
134157
135158 // Optional. The time window for the asset history. Both start_time and
136159 // end_time are optional and if set, it must be after 2018-10-02 UTC. If
137160 // end_time is not set, it is default to current timestamp. If start_time is
138161 // not set, the snapshot of the assets at end_time will be returned. The
139162 // returned results contain all temporal assets whose time window overlap with
140163 // read_time_window.
141- TimeWindow read_time_window = 4 ;
164+ TimeWindow read_time_window = 4 [ (google.api .field_behavior ) = OPTIONAL ] ;
142165}
143166
144167// Batch get assets history response.
@@ -166,6 +189,16 @@ message GcsDestination {
166189 // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
167190 // for more information.
168191 string uri = 1 ;
192+
193+ // The uri prefix of all generated Cloud Storage objects. For example:
194+ // "gs://bucket_name/object_name_prefix". Each object uri is in format:
195+ // "gs://bucket_name/object_name_prefix/<asset type>/<shard number> and only
196+ // contains assets for that type. <shard number> starts from 0. For example:
197+ // "gs://bucket_name/object_name_prefix/google.compute.disk/0" is the first
198+ // shard of output objects containing all google.compute.disk assets.
199+ // An INVALID_ARGUMENT error will be returned if file with the same name
200+ // "gs://bucket_name/object_name_prefix" already exists.
201+ string uri_prefix = 2 ;
169202 }
170203}
171204
0 commit comments