1
- // Copyright 2018 Google LLC.
1
+ // Copyright 2019 Google LLC.
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@ syntax = "proto3";
18
18
package google.cloud.asset.v1beta1 ;
19
19
20
20
import "google/api/annotations.proto" ;
21
+ import "google/api/client.proto" ;
22
+ import "google/api/field_behavior.proto" ;
23
+ import "google/api/resource.proto" ;
21
24
import "google/cloud/asset/v1beta1/assets.proto" ;
22
25
import "google/longrunning/operations.proto" ;
23
26
import "google/protobuf/timestamp.proto" ;
@@ -31,6 +34,10 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1";
31
34
32
35
// Asset service definition.
33
36
service 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
+
34
41
// Exports assets with time and resource types to a given Cloud Storage
35
42
// location. The output format is newline-delimited JSON.
36
43
// This API implements the
@@ -49,13 +56,19 @@ service AssetService {
49
56
body : "*"
50
57
}
51
58
};
59
+ option (google.longrunning.operation_info ) = {
60
+ response_type : "google.cloud.asset.v1beta1.ExportAssetsResponse"
61
+ metadata_type : "google.cloud.asset.v1beta1.ExportAssetsRequest"
62
+ };
52
63
}
53
64
54
65
// Batch gets the update history of assets that overlap a time window.
55
66
// For RESOURCE content, this API outputs history with asset in both
56
67
// non-delete or deleted status.
57
68
// For IAM_POLICY content, this API outputs history when the asset and its
58
69
// 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.
59
72
rpc BatchGetAssetsHistory (BatchGetAssetsHistoryRequest )
60
73
returns (BatchGetAssetsHistoryResponse ) {
61
74
option (google.api.http ) = {
@@ -73,7 +86,12 @@ message ExportAssetsRequest {
73
86
// organization number (such as "organizations/123"), a project ID (such as
74
87
// "projects/my-project-id"), a project number (such as "projects/12345"), or
75
88
// 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
+ ];
77
95
78
96
// Timestamp to take an asset snapshot. This can only be set to a timestamp
79
97
// between 2018-10-02 UTC (inclusive) and the current time. If not specified,
@@ -95,7 +113,7 @@ message ExportAssetsRequest {
95
113
96
114
// Required. Output configuration indicating where the results will be output
97
115
// 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 ] ;
99
117
}
100
118
101
119
// The export asset response. This message is returned by the
@@ -117,7 +135,12 @@ message BatchGetAssetsHistoryRequest {
117
135
// Required. The relative name of the root asset. It can only be an
118
136
// organization number (such as "organizations/123"), a project ID (such as
119
137
// "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
+ ];
121
144
122
145
// A list of the full names of the assets. For example:
123
146
// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
@@ -129,16 +152,16 @@ message BatchGetAssetsHistoryRequest {
129
152
// size of the asset name list is 100 in one request.
130
153
repeated string asset_names = 2 ;
131
154
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 ] ;
134
157
135
158
// Optional. The time window for the asset history. Both start_time and
136
159
// end_time are optional and if set, it must be after 2018-10-02 UTC. If
137
160
// end_time is not set, it is default to current timestamp. If start_time is
138
161
// not set, the snapshot of the assets at end_time will be returned. The
139
162
// returned results contain all temporal assets whose time window overlap with
140
163
// read_time_window.
141
- TimeWindow read_time_window = 4 ;
164
+ TimeWindow read_time_window = 4 [ (google.api .field_behavior ) = OPTIONAL ] ;
142
165
}
143
166
144
167
// Batch get assets history response.
@@ -166,6 +189,16 @@ message GcsDestination {
166
189
// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
167
190
// for more information.
168
191
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 ;
169
202
}
170
203
}
171
204
0 commit comments