Skip to content

Commit 1e8aa17

Browse files
feat: [kmsinventory] add resource_types to SearchAllResources, to allow filtering by resource type (#9641)
* feat: add resource_types to SearchAllResources, to allow filtering by resource type PiperOrigin-RevId: 547834040 Source-Link: googleapis/googleapis@ecb3e47 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6869315f60f1a202968f66fb11b07483b11148fc Copy-Tag: eyJwIjoiamF2YS1rbXNpbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6IjY4NjkzMTVmNjBmMWEyMDI5NjhmNjZmYjExYjA3NDgzYjExMTQ4ZmMifQ== * 🦉 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 0205042 commit 1e8aa17

File tree

11 files changed

+620
-43
lines changed

11 files changed

+620
-43
lines changed

java-kmsinventory/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2323
<dependency>
2424
<groupId>com.google.cloud</groupId>
2525
<artifactId>libraries-bom</artifactId>
26-
<version>26.16.0</version>
26+
<version>26.18.0</version>
2727
<type>pom</type>
2828
<scope>import</scope>
2929
</dependency>
@@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
201201
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-kmsinventory/java11.html
202202
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
203203
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-kmsinventory.svg
204-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kmsinventory/0.8.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kmsinventory/0.10.0
205205
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
206206
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
207207
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-kmsinventory/google-cloud-kmsinventory/src/main/java/com/google/cloud/kms/inventory/v1/KeyTrackingServiceClient.java

+3
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
489489
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
490490
* .setPageSize(883849137)
491491
* .setPageToken("pageToken873572522")
492+
* .addAllResourceTypes(new ArrayList<String>())
492493
* .build();
493494
* for (ProtectedResource element :
494495
* keyTrackingServiceClient.searchProtectedResources(request).iterateAll()) {
@@ -525,6 +526,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
525526
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
526527
* .setPageSize(883849137)
527528
* .setPageToken("pageToken873572522")
529+
* .addAllResourceTypes(new ArrayList<String>())
528530
* .build();
529531
* ApiFuture<ProtectedResource> future =
530532
* keyTrackingServiceClient.searchProtectedResourcesPagedCallable().futureCall(request);
@@ -560,6 +562,7 @@ public final SearchProtectedResourcesPagedResponse searchProtectedResources(
560562
* .setCryptoKey(OrganizationName.of("[ORGANIZATION]").toString())
561563
* .setPageSize(883849137)
562564
* .setPageToken("pageToken873572522")
565+
* .addAllResourceTypes(new ArrayList<String>())
563566
* .build();
564567
* while (true) {
565568
* SearchProtectedResourcesResponse response =

java-kmsinventory/google-cloud-kmsinventory/src/main/java/com/google/cloud/kms/inventory/v1/stub/HttpJsonKeyTrackingServiceStub.java

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public class HttpJsonKeyTrackingServiceStub extends KeyTrackingServiceStub {
120120
serializer.putQueryParam(fields, "cryptoKey", request.getCryptoKey());
121121
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
122122
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
123+
serializer.putQueryParam(
124+
fields, "resourceTypes", request.getResourceTypesList());
123125
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
124126
return fields;
125127
})

java-kmsinventory/proto-google-cloud-kmsinventory-v1/src/main/java/com/google/cloud/kms/inventory/v1/KeyTrackingServiceProto.java

+40-39
Original file line numberDiff line numberDiff line change
@@ -102,48 +102,49 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
102102
+ "s/{project}/locations/{location}/keyRing"
103103
+ "s/{key_ring}/cryptoKeys/{crypto_key}/cry"
104104
+ "ptoKeyVersions/{crypto_key_version}/prot"
105-
+ "ectedResourcesSummary\"\262\001\n\037SearchProtecte"
105+
+ "ectedResourcesSummary\"\320\001\n\037SearchProtecte"
106106
+ "dResourcesRequest\022H\n\005scope\030\002 \001(\tB9\342A\001\002\372A"
107107
+ "2\n0cloudresourcemanager.googleapis.com/O"
108108
+ "rganization\022\036\n\ncrypto_key\030\001 \001(\tB\n\342A\001\002\372A\003"
109109
+ "\n\001*\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001"
110-
+ "(\t\"\212\001\n SearchProtectedResourcesResponse\022"
111-
+ "M\n\023protected_resources\030\001 \003(\01320.google.cl"
112-
+ "oud.kms.inventory.v1.ProtectedResource\022\027"
113-
+ "\n\017next_page_token\030\002 \001(\t\"\372\003\n\021ProtectedRes"
114-
+ "ource\022\014\n\004name\030\001 \001(\t\022\017\n\007project\030\002 \001(\t\022\022\n\n"
115-
+ "project_id\030\t \001(\t\022\025\n\rcloud_product\030\010 \001(\t\022"
116-
+ "\025\n\rresource_type\030\003 \001(\t\022\020\n\010location\030\004 \001(\t"
117-
+ "\022L\n\006labels\030\005 \003(\0132<.google.cloud.kms.inve"
118-
+ "ntory.v1.ProtectedResource.LabelsEntry\022I"
119-
+ "\n\022crypto_key_version\030\006 \001(\tB-\372A*\n(cloudkm"
120-
+ "s.googleapis.com/CryptoKeyVersion\022J\n\023cry"
121-
+ "pto_key_versions\030\n \003(\tB-\372A*\n(cloudkms.go"
122-
+ "ogleapis.com/CryptoKeyVersion\0225\n\013create_"
123-
+ "time\030\007 \001(\0132\032.google.protobuf.TimestampB\004"
124-
+ "\342A\001\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu"
125-
+ "e\030\002 \001(\t:\0028\001:\'\352A$\n\037cloudasset.googleapis."
126-
+ "com/Asset\022\001*2\332\004\n\022KeyTrackingService\022\201\002\n\034"
127-
+ "GetProtectedResourcesSummary\022B.google.cl"
128-
+ "oud.kms.inventory.v1.GetProtectedResourc"
129-
+ "esSummaryRequest\0328.google.cloud.kms.inve"
130-
+ "ntory.v1.ProtectedResourcesSummary\"c\332A\004n"
131-
+ "ame\202\323\344\223\002V\022T/v1/{name=projects/*/location"
132-
+ "s/*/keyRings/*/cryptoKeys/**}/protectedR"
133-
+ "esourcesSummary\022\356\001\n\030SearchProtectedResou"
134-
+ "rces\022>.google.cloud.kms.inventory.v1.Sea"
135-
+ "rchProtectedResourcesRequest\032?.google.cl"
136-
+ "oud.kms.inventory.v1.SearchProtectedReso"
137-
+ "urcesResponse\"Q\332A\021scope, crypto_key\202\323\344\223\002"
138-
+ "7\0225/v1/{scope=organizations/*}/protected"
139-
+ "Resources:search\032O\312A\033kmsinventory.google"
140-
+ "apis.com\322A.https://www.googleapis.com/au"
141-
+ "th/cloud-platformB\302\001\n!com.google.cloud.k"
142-
+ "ms.inventory.v1B\027KeyTrackingServiceProto"
143-
+ "P\001Z?cloud.google.com/go/kms/inventory/ap"
144-
+ "iv1/inventorypb;inventorypb\370\001\001\252\002\035Google."
145-
+ "Cloud.Kms.Inventory.V1\312\002\035Google\\Cloud\\Km"
146-
+ "s\\Inventory\\V1b\006proto3"
110+
+ "(\t\022\034\n\016resource_types\030\005 \003(\tB\004\342A\001\001\"\212\001\n Sea"
111+
+ "rchProtectedResourcesResponse\022M\n\023protect"
112+
+ "ed_resources\030\001 \003(\01320.google.cloud.kms.in"
113+
+ "ventory.v1.ProtectedResource\022\027\n\017next_pag"
114+
+ "e_token\030\002 \001(\t\"\372\003\n\021ProtectedResource\022\014\n\004n"
115+
+ "ame\030\001 \001(\t\022\017\n\007project\030\002 \001(\t\022\022\n\nproject_id"
116+
+ "\030\t \001(\t\022\025\n\rcloud_product\030\010 \001(\t\022\025\n\rresourc"
117+
+ "e_type\030\003 \001(\t\022\020\n\010location\030\004 \001(\t\022L\n\006labels"
118+
+ "\030\005 \003(\0132<.google.cloud.kms.inventory.v1.P"
119+
+ "rotectedResource.LabelsEntry\022I\n\022crypto_k"
120+
+ "ey_version\030\006 \001(\tB-\372A*\n(cloudkms.googleap"
121+
+ "is.com/CryptoKeyVersion\022J\n\023crypto_key_ve"
122+
+ "rsions\030\n \003(\tB-\372A*\n(cloudkms.googleapis.c"
123+
+ "om/CryptoKeyVersion\0225\n\013create_time\030\007 \001(\013"
124+
+ "2\032.google.protobuf.TimestampB\004\342A\001\003\032-\n\013La"
125+
+ "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028"
126+
+ "\001:\'\352A$\n\037cloudasset.googleapis.com/Asset\022"
127+
+ "\001*2\332\004\n\022KeyTrackingService\022\201\002\n\034GetProtect"
128+
+ "edResourcesSummary\022B.google.cloud.kms.in"
129+
+ "ventory.v1.GetProtectedResourcesSummaryR"
130+
+ "equest\0328.google.cloud.kms.inventory.v1.P"
131+
+ "rotectedResourcesSummary\"c\332A\004name\202\323\344\223\002V\022"
132+
+ "T/v1/{name=projects/*/locations/*/keyRin"
133+
+ "gs/*/cryptoKeys/**}/protectedResourcesSu"
134+
+ "mmary\022\356\001\n\030SearchProtectedResources\022>.goo"
135+
+ "gle.cloud.kms.inventory.v1.SearchProtect"
136+
+ "edResourcesRequest\032?.google.cloud.kms.in"
137+
+ "ventory.v1.SearchProtectedResourcesRespo"
138+
+ "nse\"Q\332A\021scope, crypto_key\202\323\344\223\0027\0225/v1/{sc"
139+
+ "ope=organizations/*}/protectedResources:"
140+
+ "search\032O\312A\033kmsinventory.googleapis.com\322A"
141+
+ ".https://www.googleapis.com/auth/cloud-p"
142+
+ "latformB\302\001\n!com.google.cloud.kms.invento"
143+
+ "ry.v1B\027KeyTrackingServiceProtoP\001Z?cloud."
144+
+ "google.com/go/kms/inventory/apiv1/invent"
145+
+ "orypb;inventorypb\370\001\001\252\002\035Google.Cloud.Kms."
146+
+ "Inventory.V1\312\002\035Google\\Cloud\\Kms\\Inventor"
147+
+ "y\\V1b\006proto3"
147148
};
148149
descriptor =
149150
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -212,7 +213,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
212213
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
213214
internal_static_google_cloud_kms_inventory_v1_SearchProtectedResourcesRequest_descriptor,
214215
new java.lang.String[] {
215-
"Scope", "CryptoKey", "PageSize", "PageToken",
216+
"Scope", "CryptoKey", "PageSize", "PageToken", "ResourceTypes",
216217
});
217218
internal_static_google_cloud_kms_inventory_v1_SearchProtectedResourcesResponse_descriptor =
218219
getDescriptor().getMessageTypes().get(3);

0 commit comments

Comments
 (0)