Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / cloud / asset / v1 / asset_service.proto
1 // Copyright 2019 Google LLC.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15
16 syntax = "proto3";
17
18 package google.cloud.asset.v1;
19
20 import "google/api/annotations.proto";
21 import "google/cloud/asset/v1/assets.proto";
22 import "google/longrunning/operations.proto";
23 import "google/protobuf/timestamp.proto";
24
25 option csharp_namespace = "Google.Cloud.Asset.V1";
26 option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset";
27 option java_multiple_files = true;
28 option java_outer_classname = "AssetServiceProto";
29 option java_package = "com.google.cloud.asset.v1";
30 option php_namespace = "Google\\Cloud\\Asset\\V1";
31
32
33 // Asset service definition.
34 service AssetService {
35   // Exports assets with time and resource types to a given Cloud Storage
36   // location. The output format is newline-delimited JSON.
37   // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you
38   // to keep track of the export.
39   rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) {
40     option (google.api.http) = {
41       post: "/v1/{parent=*/*}:exportAssets"
42       body: "*"
43     };
44   }
45
46   // Batch gets the update history of assets that overlap a time window.
47   // For RESOURCE content, this API outputs history with asset in both
48   // non-delete or deleted status.
49   // For IAM_POLICY content, this API outputs history when the asset and its
50   // attached IAM POLICY both exist. This can create gaps in the output history.
51   // If a specified asset does not exist, this API returns an INVALID_ARGUMENT
52   // error.
53   rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) {
54     option (google.api.http) = {
55       get: "/v1/{parent=*/*}:batchGetAssetsHistory"
56     };
57   }
58 }
59
60 // Export asset request.
61 message ExportAssetsRequest {
62   // Required. The relative name of the root asset. This can only be an
63   // organization number (such as "organizations/123"), a project ID (such as
64   // "projects/my-project-id"), or a project number (such as "projects/12345"),
65   // or a folder number (such as "folders/123").
66   string parent = 1;
67
68   // Timestamp to take an asset snapshot. This can only be set to a timestamp
69   // between 2018-10-02 UTC (inclusive) and the current time. If not specified,
70   // the current time will be used. Due to delays in resource data collection
71   // and indexing, there is a volatile window during which running the same
72   // query may get different results.
73   google.protobuf.Timestamp read_time = 2;
74
75   // A list of asset types of which to take a snapshot for. For example:
76   // "compute.googleapis.com/Disk". If specified, only matching assets will be returned.
77   // See [Introduction to Cloud Asset
78   // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
79   // for all supported asset types.
80   repeated string asset_types = 3;
81
82   // Asset content type. If not specified, no content but the asset name will be
83   // returned.
84   ContentType content_type = 4;
85
86   // Required. Output configuration indicating where the results will be output
87   // to. All results will be in newline delimited JSON format.
88   OutputConfig output_config = 5;
89 }
90
91 // The export asset response. This message is returned by the
92 // [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned
93 // [google.longrunning.Operation.response][google.longrunning.Operation.response] field.
94 message ExportAssetsResponse {
95   // Time the snapshot was taken.
96   google.protobuf.Timestamp read_time = 1;
97
98   // Output configuration indicating where the results were output to.
99   // All results are in JSON format.
100   OutputConfig output_config = 2;
101 }
102
103 // Batch get assets history request.
104 message BatchGetAssetsHistoryRequest {
105   // Required. The relative name of the root asset. It can only be an
106   // organization number (such as "organizations/123"), a project ID (such as
107   // "projects/my-project-id")", or a project number (such as "projects/12345").
108   string parent = 1;
109
110   // A list of the full names of the assets. For example:
111   // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
112   // See [Resource
113   // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
114   // and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
115   // for more info.
116   //
117   // The request becomes a no-op if the asset name list is empty, and the max
118   // size of the asset name list is 100 in one request.
119   repeated string asset_names = 2;
120
121   // Required. The content type.
122   ContentType content_type = 3;
123
124   // Optional. The time window for the asset history. Both start_time and
125   // end_time are optional and if set, it must be after 2018-10-02 UTC. If
126   // end_time is not set, it is default to current timestamp. If start_time is
127   // not set, the snapshot of the assets at end_time will be returned. The
128   // returned results contain all temporal assets whose time window overlap with
129   // read_time_window.
130   TimeWindow read_time_window = 4;
131 }
132
133 // Batch get assets history response.
134 message BatchGetAssetsHistoryResponse {
135   // A list of assets with valid time windows.
136   repeated TemporalAsset assets = 1;
137 }
138
139 // Output configuration for export assets destination.
140 message OutputConfig {
141   // Asset export destination.
142   oneof destination {
143     // Destination on Cloud Storage.
144     GcsDestination gcs_destination = 1;
145   }
146 }
147
148 // A Cloud Storage location.
149 message GcsDestination {
150   // Required.
151   oneof object_uri {
152     // The uri of the Cloud Storage object. It's the same uri that is used by
153     // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and
154     // Editing Object
155     // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
156     // for more information.
157     string uri = 1;
158   }
159 }
160
161 // Asset content type.
162 enum ContentType {
163   // Unspecified content type.
164   CONTENT_TYPE_UNSPECIFIED = 0;
165
166   // Resource metadata.
167   RESOURCE = 1;
168
169   // The actual IAM policy set on a resource.
170   IAM_POLICY = 2;
171 }