Skip to content

Commit 63c73fb

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add client library support for AssetService v1 BatchGetEffectiveIamPolicies API
Committer: haochunzhang@ PiperOrigin-RevId: 466134014
1 parent d89cf3d commit 63c73fb

4 files changed

Lines changed: 55 additions & 28 deletions

File tree

google/cloud/asset/v1/asset_service.proto

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,14 @@ message SearchAllResourcesRequest {
856856
// * `labels.env:*` to find Cloud resources that have a label "env".
857857
// * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
858858
// encryption key whose name contains the word "key".
859+
// * `relationships:instance-group-1` to find Cloud resources that have
860+
// relationships with "instance-group-1" in the related resource name.
861+
// * `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that
862+
// have relationships of type "INSTANCE_TO_INSTANCEGROUP".
863+
// * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find
864+
// compute instances that have relationships with "instance-group-1" in the
865+
// compute instance group resource name, for relationship type
866+
// "INSTANCE_TO_INSTANCEGROUP".
859867
// * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
860868
// word.
861869
// * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
@@ -999,8 +1007,8 @@ message SearchAllIamPoliciesRequest {
9991007
// compared against each Cloud IAM policy binding, including its principals,
10001008
// roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
10011009
// contain the bindings that match your query. To learn more about the IAM
1002-
// policy structure, see [IAM policy
1003-
// doc](https://cloud.google.com/iam/docs/policies#structure).
1010+
// policy structure, see the [IAM policy
1011+
// documentation](https://cloud.google.com/iam/help/allow-policies/structure).
10041012
//
10051013
// Examples:
10061014
//
@@ -1730,30 +1738,6 @@ message MoveImpact {
17301738
string detail = 1;
17311739
}
17321740

1733-
// Asset content type.
1734-
enum ContentType {
1735-
// Unspecified content type.
1736-
CONTENT_TYPE_UNSPECIFIED = 0;
1737-
1738-
// Resource metadata.
1739-
RESOURCE = 1;
1740-
1741-
// The actual IAM policy set on a resource.
1742-
IAM_POLICY = 2;
1743-
1744-
// The Cloud Organization Policy set on an asset.
1745-
ORG_POLICY = 4;
1746-
1747-
// The Cloud Access context manager Policy set on an asset.
1748-
ACCESS_POLICY = 5;
1749-
1750-
// The runtime OS Inventory information.
1751-
OS_INVENTORY = 6;
1752-
1753-
// The related resources.
1754-
RELATIONSHIP = 7;
1755-
}
1756-
17571741
// A request message for
17581742
// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies].
17591743
message BatchGetEffectiveIamPoliciesRequest {
@@ -1841,3 +1825,27 @@ message BatchGetEffectiveIamPoliciesResponse {
18411825
// [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies].
18421826
repeated EffectiveIamPolicy policy_results = 2;
18431827
}
1828+
1829+
// Asset content type.
1830+
enum ContentType {
1831+
// Unspecified content type.
1832+
CONTENT_TYPE_UNSPECIFIED = 0;
1833+
1834+
// Resource metadata.
1835+
RESOURCE = 1;
1836+
1837+
// The actual IAM policy set on a resource.
1838+
IAM_POLICY = 2;
1839+
1840+
// The Cloud Organization Policy set on an asset.
1841+
ORG_POLICY = 4;
1842+
1843+
// The Cloud Access context manager Policy set on an asset.
1844+
ACCESS_POLICY = 5;
1845+
1846+
// The runtime OS Inventory information.
1847+
OS_INVENTORY = 6;
1848+
1849+
// The related resources.
1850+
RELATIONSHIP = 7;
1851+
}

google/cloud/asset/v1/assets.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ message Asset {
128128
// effectively policy is the union of both the policy set on this resource
129129
// and each policy set on all of the resource's ancestry resource levels in
130130
// the hierarchy. See
131-
// [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
132-
// more information.
131+
// [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
132+
// for more information.
133133
google.iam.v1.Policy iam_policy = 4;
134134

135135
// A representation of an [organization
@@ -307,6 +307,7 @@ message RelatedAsset {
307307
}
308308

309309
// A result of Resource Search, containing information of a cloud resource.
310+
// Next ID: 29
310311
message ResourceSearchResult {
311312
// The full resource name of this resource. Example:
312313
// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.

google/cloud/asset/v1/cloudasset_grpc_service_config.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@
126126
"UNAVAILABLE"
127127
]
128128
}
129+
},
130+
{
131+
"name": [
132+
{
133+
"service": "google.cloud.asset.v1.AssetService",
134+
"method": "BatchGetEffectiveIamPolicies"
135+
}
136+
],
137+
"timeout": "300s",
138+
"retryPolicy": {
139+
"initialBackoff": "0.100s",
140+
"maxBackoff": "60s",
141+
"backoffMultiplier": 1.3,
142+
"retryableStatusCodes": [
143+
"UNAVAILABLE"
144+
]
145+
}
129146
}
130147
]
131148
}

google/cloud/asset/v1/cloudasset_v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Cloud Asset API
55

66
apis:
77
- name: google.cloud.asset.v1.AssetService
8+
- name: google.longrunning.Operations
89

910
types:
1011
- name: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata

0 commit comments

Comments
 (0)