Content-Length: 616508 | pFad | https://www.github.com/googleapis/python-asset/commit/15b60a349c93c928fe121dc47d44d812a0c14439

79B feat: remove search resources and search iam policies support in v1p1… · googleapis/python-asset@15b60a3 · GitHub
Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 15b60a3

Browse files
feat: remove search resources and search iam policies support in v1p1beta1; remove export assets and batch get assets history from v1p2beta1 (via synth) (#12)
1 parent 25c687b commit 15b60a3

28 files changed

+397
-2408
lines changed

google/cloud/asset_v1beta1/gapic/asset_service_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ def batch_get_assets_history(
332332
RESOURCE content, this API outputs history with asset in both non-delete
333333
or deleted status. For IAM\_POLICY content, this API outputs history
334334
when the asset and its attached IAM POLICY both exist. This can create
335-
gaps in the output history.
335+
gaps in the output history. If a specified asset does not exist, this
336+
API returns an INVALID\_ARGUMENT error.
336337
337338
Example:
338339
>>> from google.cloud import asset_v1beta1
@@ -354,7 +355,7 @@ def batch_get_assets_history(
354355
parent (str): Required. The relative name of the root asset. It can only be an
355356
organization number (such as "organizations/123"), a project ID (such as
356357
"projects/my-project-id")", or a project number (such as "projects/12345").
357-
content_type (~google.cloud.asset_v1beta1.types.ContentType): Required. The content type.
358+
content_type (~google.cloud.asset_v1beta1.types.ContentType): Optional. The content type.
358359
read_time_window (Union[dict, ~google.cloud.asset_v1beta1.types.TimeWindow]): Optional. The time window for the asset history. Both start\_time and
359360
end\_time are optional and if set, it must be after 2018-10-02 UTC. If
360361
end\_time is not set, it is default to current timestamp. If start\_time

google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def batch_get_assets_history(self):
139139
RESOURCE content, this API outputs history with asset in both non-delete
140140
or deleted status. For IAM\_POLICY content, this API outputs history
141141
when the asset and its attached IAM POLICY both exist. This can create
142-
gaps in the output history.
142+
gaps in the output history. If a specified asset does not exist, this
143+
API returns an INVALID\_ARGUMENT error.
143144
144145
Returns:
145146
Callable: A callable which accepts the appropriate

google/cloud/asset_v1beta1/proto/asset_service.proto

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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";
1818
package google.cloud.asset.v1beta1;
1919

2020
import "google/api/annotations.proto";
21+
import "google/api/client.proto";
22+
import "google/api/field_behavior.proto";
23+
import "google/api/resource.proto";
2124
import "google/cloud/asset/v1beta1/assets.proto";
2225
import "google/longrunning/operations.proto";
2326
import "google/protobuf/timestamp.proto";
@@ -31,6 +34,10 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1";
3134

3235
// Asset service definition.
3336
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+
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

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://www.github.com/googleapis/python-asset/commit/15b60a349c93c928fe121dc47d44d812a0c14439

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy