Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 30a184b

Browse files
feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API (#462)
* feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API Committer: haochunzhang@ PiperOrigin-RevId: 466134014 Source-Link: googleapis/googleapis@63c73fb Source-Link: https://github.com/googleapis/googleapis-gen/commit/2350945f7a70ecaaecf9a1fdd7d6e70ac50e862d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjM1MDk0NWY3YTcwZWNhYWVjZjlhMWZkZDdkNmU3MGFjNTBlODYyZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6e33c1f commit 30a184b

File tree

5 files changed

+60
-10
lines changed

5 files changed

+60
-10
lines changed

google/cloud/asset_v1/services/asset_service/async_client.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,17 @@ async def sample_search_all_resources():
11461146
- ``kmsKey:key`` to find Cloud resources encrypted with
11471147
a customer-managed encryption key whose name contains
11481148
the word "key".
1149+
- ``relationships:instance-group-1`` to find Cloud
1150+
resources that have relationships with
1151+
"instance-group-1" in the related resource name.
1152+
- ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find
1153+
compute instances that have relationships of type
1154+
"INSTANCE_TO_INSTANCEGROUP".
1155+
- ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1``
1156+
to find compute instances that have relationships
1157+
with "instance-group-1" in the compute instance group
1158+
resource name, for relationship type
1159+
"INSTANCE_TO_INSTANCEGROUP".
11491160
- ``state:ACTIVE`` to find Cloud resources whose state
11501161
contains "ACTIVE" as a word.
11511162
- ``NOT state:ACTIVE`` to find Cloud resources whose
@@ -1339,8 +1350,8 @@ async def sample_search_all_iam_policies():
13391350
principals, roles, and Cloud IAM conditions. The
13401351
returned Cloud IAM policies will only contain the
13411352
bindings that match your query. To learn more about the
1342-
IAM policy structure, see `IAM policy
1343-
doc <https://cloud.google.com/iam/docs/policies#structure>`__.
1353+
IAM policy structure, see the `IAM policy
1354+
documentation <https://cloud.google.com/iam/help/allow-policies/structure>`__.
13441355
13451356
Examples:
13461357
@@ -2326,7 +2337,16 @@ async def sample_batch_get_effective_iam_policies():
23262337
# and friendly error handling.
23272338
rpc = gapic_v1.method_async.wrap_method(
23282339
self._client._transport.batch_get_effective_iam_policies,
2329-
default_timeout=None,
2340+
default_retry=retries.Retry(
2341+
initial=0.1,
2342+
maximum=60.0,
2343+
multiplier=1.3,
2344+
predicate=retries.if_exception_type(
2345+
core_exceptions.ServiceUnavailable,
2346+
),
2347+
deadline=300.0,
2348+
),
2349+
default_timeout=300.0,
23302350
client_info=DEFAULT_CLIENT_INFO,
23312351
)
23322352

google/cloud/asset_v1/services/asset_service/client.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,17 @@ def sample_search_all_resources():
14071407
- ``kmsKey:key`` to find Cloud resources encrypted with
14081408
a customer-managed encryption key whose name contains
14091409
the word "key".
1410+
- ``relationships:instance-group-1`` to find Cloud
1411+
resources that have relationships with
1412+
"instance-group-1" in the related resource name.
1413+
- ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find
1414+
compute instances that have relationships of type
1415+
"INSTANCE_TO_INSTANCEGROUP".
1416+
- ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1``
1417+
to find compute instances that have relationships
1418+
with "instance-group-1" in the compute instance group
1419+
resource name, for relationship type
1420+
"INSTANCE_TO_INSTANCEGROUP".
14101421
- ``state:ACTIVE`` to find Cloud resources whose state
14111422
contains "ACTIVE" as a word.
14121423
- ``NOT state:ACTIVE`` to find Cloud resources whose
@@ -1591,8 +1602,8 @@ def sample_search_all_iam_policies():
15911602
principals, roles, and Cloud IAM conditions. The
15921603
returned Cloud IAM policies will only contain the
15931604
bindings that match your query. To learn more about the
1594-
IAM policy structure, see `IAM policy
1595-
doc <https://cloud.google.com/iam/docs/policies#structure>`__.
1605+
IAM policy structure, see the `IAM policy
1606+
documentation <https://cloud.google.com/iam/help/allow-policies/structure>`__.
15961607
15971608
Examples:
15981609

google/cloud/asset_v1/services/asset_service/transports/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,16 @@ def _prep_wrapped_messages(self, client_info):
299299
),
300300
self.batch_get_effective_iam_policies: gapic_v1.method.wrap_method(
301301
self.batch_get_effective_iam_policies,
302-
default_timeout=None,
302+
default_retry=retries.Retry(
303+
initial=0.1,
304+
maximum=60.0,
305+
multiplier=1.3,
306+
predicate=retries.if_exception_type(
307+
core_exceptions.ServiceUnavailable,
308+
),
309+
deadline=300.0,
310+
),
311+
default_timeout=300.0,
303312
client_info=client_info,
304313
),
305314
}

google/cloud/asset_v1/types/asset_service.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,16 @@ class SearchAllResourcesRequest(proto.Message):
10581058
- ``kmsKey:key`` to find Cloud resources encrypted with a
10591059
customer-managed encryption key whose name contains the
10601060
word "key".
1061+
- ``relationships:instance-group-1`` to find Cloud
1062+
resources that have relationships with "instance-group-1"
1063+
in the related resource name.
1064+
- ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find
1065+
compute instances that have relationships of type
1066+
"INSTANCE_TO_INSTANCEGROUP".
1067+
- ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1``
1068+
to find compute instances that have relationships with
1069+
"instance-group-1" in the compute instance group resource
1070+
name, for relationship type "INSTANCE_TO_INSTANCEGROUP".
10611071
- ``state:ACTIVE`` to find Cloud resources whose state
10621072
contains "ACTIVE" as a word.
10631073
- ``NOT state:ACTIVE`` to find Cloud resources whose state
@@ -1257,8 +1267,8 @@ class SearchAllIamPoliciesRequest(proto.Message):
12571267
IAM policy binding, including its principals, roles, and
12581268
Cloud IAM conditions. The returned Cloud IAM policies will
12591269
only contain the bindings that match your query. To learn
1260-
more about the IAM policy structure, see `IAM policy
1261-
doc <https://cloud.google.com/iam/docs/policies#structure>`__.
1270+
more about the IAM policy structure, see the `IAM policy
1271+
documentation <https://cloud.google.com/iam/help/allow-policies/structure>`__.
12621272
12631273
Examples:
12641274

google/cloud/asset_v1/types/assets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Asset(proto.Message):
176176
policy set on this resource and each policy set on all of
177177
the resource's ancestry resource levels in the hierarchy.
178178
See `this
179-
topic <https://cloud.google.com/iam/docs/policies#inheritance>`__
179+
topic <https://cloud.google.com/iam/help/allow-policies/inheritance>`__
180180
for more information.
181181
org_policy (Sequence[google.cloud.orgpolicy.v1.orgpolicy_pb2.Policy]):
182182
A representation of an `organization
@@ -496,7 +496,7 @@ class RelatedAsset(proto.Message):
496496

497497
class ResourceSearchResult(proto.Message):
498498
r"""A result of Resource Search, containing information of a
499-
cloud resource.
499+
cloud resource. Next ID: 29
500500
501501
Attributes:
502502
name (str):

0 commit comments

Comments
 (0)