Skip to content

Commit 81b9849

Browse files
feat: [cloudkms] added VerifyConnectivity RPC (#9429)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 530991686 Source-Link: https://togithub.com/googleapis/googleapis/commit/be2600ed6ce9f63ceb9db0bda82e385575f59446 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/7eadc0e0aaece2bccb4e561f3b29b0584fbcf906 Copy-Tag: eyJwIjoiamF2YS1rbXMvLk93bEJvdC55YW1sIiwiaCI6IjdlYWRjMGUwYWFlY2UyYmNjYjRlNTYxZjNiMjliMDU4NGZiY2Y5MDYifQ==
1 parent 3cba89a commit 81b9849

File tree

22 files changed

+2009
-13
lines changed

22 files changed

+2009
-13
lines changed

java-kms/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.11.0</version>
23+
<version>26.14.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-kms.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kms/2.17.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-kms/2.20.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/EkmServiceClient.java

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,135 @@ public final UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCal
920920
return stub.updateEkmConfigCallable();
921921
}
922922

923+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
924+
/**
925+
* Verifies that Cloud KMS can successfully connect to the external key manager specified by an
926+
* [EkmConnection][google.cloud.kms.v1.EkmConnection]. If there is an error connecting to the EKM,
927+
* this method returns a FAILED_PRECONDITION status containing structured information as described
928+
* at https://cloud.google.com/kms/docs/reference/ekm_errors.
929+
*
930+
* <p>Sample code:
931+
*
932+
* <pre>{@code
933+
* // This snippet has been automatically generated and should be regarded as a code template only.
934+
* // It will require modifications to work:
935+
* // - It may require correct/in-range values for request initialization.
936+
* // - It may require specifying regional endpoints when creating the service client as shown in
937+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
938+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
939+
* EkmConnectionName name = EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
940+
* VerifyConnectivityResponse response = ekmServiceClient.verifyConnectivity(name);
941+
* }
942+
* }</pre>
943+
*
944+
* @param name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the
945+
* [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify.
946+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
947+
*/
948+
public final VerifyConnectivityResponse verifyConnectivity(EkmConnectionName name) {
949+
VerifyConnectivityRequest request =
950+
VerifyConnectivityRequest.newBuilder()
951+
.setName(name == null ? null : name.toString())
952+
.build();
953+
return verifyConnectivity(request);
954+
}
955+
956+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
957+
/**
958+
* Verifies that Cloud KMS can successfully connect to the external key manager specified by an
959+
* [EkmConnection][google.cloud.kms.v1.EkmConnection]. If there is an error connecting to the EKM,
960+
* this method returns a FAILED_PRECONDITION status containing structured information as described
961+
* at https://cloud.google.com/kms/docs/reference/ekm_errors.
962+
*
963+
* <p>Sample code:
964+
*
965+
* <pre>{@code
966+
* // This snippet has been automatically generated and should be regarded as a code template only.
967+
* // It will require modifications to work:
968+
* // - It may require correct/in-range values for request initialization.
969+
* // - It may require specifying regional endpoints when creating the service client as shown in
970+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
971+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
972+
* String name = EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]").toString();
973+
* VerifyConnectivityResponse response = ekmServiceClient.verifyConnectivity(name);
974+
* }
975+
* }</pre>
976+
*
977+
* @param name Required. The [name][google.cloud.kms.v1.EkmConnection.name] of the
978+
* [EkmConnection][google.cloud.kms.v1.EkmConnection] to verify.
979+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
980+
*/
981+
public final VerifyConnectivityResponse verifyConnectivity(String name) {
982+
VerifyConnectivityRequest request =
983+
VerifyConnectivityRequest.newBuilder().setName(name).build();
984+
return verifyConnectivity(request);
985+
}
986+
987+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
988+
/**
989+
* Verifies that Cloud KMS can successfully connect to the external key manager specified by an
990+
* [EkmConnection][google.cloud.kms.v1.EkmConnection]. If there is an error connecting to the EKM,
991+
* this method returns a FAILED_PRECONDITION status containing structured information as described
992+
* at https://cloud.google.com/kms/docs/reference/ekm_errors.
993+
*
994+
* <p>Sample code:
995+
*
996+
* <pre>{@code
997+
* // This snippet has been automatically generated and should be regarded as a code template only.
998+
* // It will require modifications to work:
999+
* // - It may require correct/in-range values for request initialization.
1000+
* // - It may require specifying regional endpoints when creating the service client as shown in
1001+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1002+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
1003+
* VerifyConnectivityRequest request =
1004+
* VerifyConnectivityRequest.newBuilder()
1005+
* .setName(
1006+
* EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]").toString())
1007+
* .build();
1008+
* VerifyConnectivityResponse response = ekmServiceClient.verifyConnectivity(request);
1009+
* }
1010+
* }</pre>
1011+
*
1012+
* @param request The request object containing all of the parameters for the API call.
1013+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1014+
*/
1015+
public final VerifyConnectivityResponse verifyConnectivity(VerifyConnectivityRequest request) {
1016+
return verifyConnectivityCallable().call(request);
1017+
}
1018+
1019+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1020+
/**
1021+
* Verifies that Cloud KMS can successfully connect to the external key manager specified by an
1022+
* [EkmConnection][google.cloud.kms.v1.EkmConnection]. If there is an error connecting to the EKM,
1023+
* this method returns a FAILED_PRECONDITION status containing structured information as described
1024+
* at https://cloud.google.com/kms/docs/reference/ekm_errors.
1025+
*
1026+
* <p>Sample code:
1027+
*
1028+
* <pre>{@code
1029+
* // This snippet has been automatically generated and should be regarded as a code template only.
1030+
* // It will require modifications to work:
1031+
* // - It may require correct/in-range values for request initialization.
1032+
* // - It may require specifying regional endpoints when creating the service client as shown in
1033+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1034+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
1035+
* VerifyConnectivityRequest request =
1036+
* VerifyConnectivityRequest.newBuilder()
1037+
* .setName(
1038+
* EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]").toString())
1039+
* .build();
1040+
* ApiFuture<VerifyConnectivityResponse> future =
1041+
* ekmServiceClient.verifyConnectivityCallable().futureCall(request);
1042+
* // Do something.
1043+
* VerifyConnectivityResponse response = future.get();
1044+
* }
1045+
* }</pre>
1046+
*/
1047+
public final UnaryCallable<VerifyConnectivityRequest, VerifyConnectivityResponse>
1048+
verifyConnectivityCallable() {
1049+
return stub.verifyConnectivityCallable();
1050+
}
1051+
9231052
// AUTO-GENERATED DOCUMENTATION AND METHOD.
9241053
/**
9251054
* Lists information about the supported locations for this service.

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/EkmServiceSettings.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public UnaryCallSettings<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSetti
118118
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConfigSettings();
119119
}
120120

121+
/** Returns the object with the settings used for calls to verifyConnectivity. */
122+
public UnaryCallSettings<VerifyConnectivityRequest, VerifyConnectivityResponse>
123+
verifyConnectivitySettings() {
124+
return ((EkmServiceStubSettings) getStubSettings()).verifyConnectivitySettings();
125+
}
126+
121127
/** Returns the object with the settings used for calls to listLocations. */
122128
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
123129
listLocationsSettings() {
@@ -294,6 +300,12 @@ public UnaryCallSettings.Builder<UpdateEkmConfigRequest, EkmConfig> updateEkmCon
294300
return getStubSettingsBuilder().updateEkmConfigSettings();
295301
}
296302

303+
/** Returns the builder for the settings used for calls to verifyConnectivity. */
304+
public UnaryCallSettings.Builder<VerifyConnectivityRequest, VerifyConnectivityResponse>
305+
verifyConnectivitySettings() {
306+
return getStubSettingsBuilder().verifyConnectivitySettings();
307+
}
308+
297309
/** Returns the builder for the settings used for calls to listLocations. */
298310
public PagedCallSettings.Builder<
299311
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
},
4343
"UpdateEkmConnection": {
4444
"methods": ["updateEkmConnection", "updateEkmConnection", "updateEkmConnectionCallable"]
45+
},
46+
"VerifyConnectivity": {
47+
"methods": ["verifyConnectivity", "verifyConnectivity", "verifyConnectivity", "verifyConnectivityCallable"]
4548
}
4649
}
4750
}

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/EkmServiceStub.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import com.google.cloud.kms.v1.ListEkmConnectionsResponse;
3131
import com.google.cloud.kms.v1.UpdateEkmConfigRequest;
3232
import com.google.cloud.kms.v1.UpdateEkmConnectionRequest;
33+
import com.google.cloud.kms.v1.VerifyConnectivityRequest;
34+
import com.google.cloud.kms.v1.VerifyConnectivityResponse;
3335
import com.google.cloud.location.GetLocationRequest;
3436
import com.google.cloud.location.ListLocationsRequest;
3537
import com.google.cloud.location.ListLocationsResponse;
@@ -80,6 +82,11 @@ public UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCallable(
8082
throw new UnsupportedOperationException("Not implemented: updateEkmConfigCallable()");
8183
}
8284

85+
public UnaryCallable<VerifyConnectivityRequest, VerifyConnectivityResponse>
86+
verifyConnectivityCallable() {
87+
throw new UnsupportedOperationException("Not implemented: verifyConnectivityCallable()");
88+
}
89+
8390
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
8491
listLocationsPagedCallable() {
8592
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/EkmServiceStubSettings.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
import com.google.cloud.kms.v1.ListEkmConnectionsResponse;
5454
import com.google.cloud.kms.v1.UpdateEkmConfigRequest;
5555
import com.google.cloud.kms.v1.UpdateEkmConnectionRequest;
56+
import com.google.cloud.kms.v1.VerifyConnectivityRequest;
57+
import com.google.cloud.kms.v1.VerifyConnectivityResponse;
5658
import com.google.cloud.location.GetLocationRequest;
5759
import com.google.cloud.location.ListLocationsRequest;
5860
import com.google.cloud.location.ListLocationsResponse;
@@ -126,6 +128,8 @@ public class EkmServiceStubSettings extends StubSettings<EkmServiceStubSettings>
126128
updateEkmConnectionSettings;
127129
private final UnaryCallSettings<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings;
128130
private final UnaryCallSettings<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSettings;
131+
private final UnaryCallSettings<VerifyConnectivityRequest, VerifyConnectivityResponse>
132+
verifyConnectivitySettings;
129133
private final PagedCallSettings<
130134
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
131135
listLocationsSettings;
@@ -283,6 +287,12 @@ public UnaryCallSettings<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSetti
283287
return updateEkmConfigSettings;
284288
}
285289

290+
/** Returns the object with the settings used for calls to verifyConnectivity. */
291+
public UnaryCallSettings<VerifyConnectivityRequest, VerifyConnectivityResponse>
292+
verifyConnectivitySettings() {
293+
return verifyConnectivitySettings;
294+
}
295+
286296
/** Returns the object with the settings used for calls to listLocations. */
287297
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
288298
listLocationsSettings() {
@@ -422,6 +432,7 @@ protected EkmServiceStubSettings(Builder settingsBuilder) throws IOException {
422432
updateEkmConnectionSettings = settingsBuilder.updateEkmConnectionSettings().build();
423433
getEkmConfigSettings = settingsBuilder.getEkmConfigSettings().build();
424434
updateEkmConfigSettings = settingsBuilder.updateEkmConfigSettings().build();
435+
verifyConnectivitySettings = settingsBuilder.verifyConnectivitySettings().build();
425436
listLocationsSettings = settingsBuilder.listLocationsSettings().build();
426437
getLocationSettings = settingsBuilder.getLocationSettings().build();
427438
setIamPolicySettings = settingsBuilder.setIamPolicySettings().build();
@@ -444,6 +455,8 @@ public static class Builder extends StubSettings.Builder<EkmServiceStubSettings,
444455
private final UnaryCallSettings.Builder<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings;
445456
private final UnaryCallSettings.Builder<UpdateEkmConfigRequest, EkmConfig>
446457
updateEkmConfigSettings;
458+
private final UnaryCallSettings.Builder<VerifyConnectivityRequest, VerifyConnectivityResponse>
459+
verifyConnectivitySettings;
447460
private final PagedCallSettings.Builder<
448461
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
449462
listLocationsSettings;
@@ -501,6 +514,7 @@ protected Builder(ClientContext clientContext) {
501514
updateEkmConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
502515
getEkmConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
503516
updateEkmConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
517+
verifyConnectivitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
504518
listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
505519
getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
506520
setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -515,6 +529,7 @@ protected Builder(ClientContext clientContext) {
515529
updateEkmConnectionSettings,
516530
getEkmConfigSettings,
517531
updateEkmConfigSettings,
532+
verifyConnectivitySettings,
518533
listLocationsSettings,
519534
getLocationSettings,
520535
setIamPolicySettings,
@@ -532,6 +547,7 @@ protected Builder(EkmServiceStubSettings settings) {
532547
updateEkmConnectionSettings = settings.updateEkmConnectionSettings.toBuilder();
533548
getEkmConfigSettings = settings.getEkmConfigSettings.toBuilder();
534549
updateEkmConfigSettings = settings.updateEkmConfigSettings.toBuilder();
550+
verifyConnectivitySettings = settings.verifyConnectivitySettings.toBuilder();
535551
listLocationsSettings = settings.listLocationsSettings.toBuilder();
536552
getLocationSettings = settings.getLocationSettings.toBuilder();
537553
setIamPolicySettings = settings.setIamPolicySettings.toBuilder();
@@ -546,6 +562,7 @@ protected Builder(EkmServiceStubSettings settings) {
546562
updateEkmConnectionSettings,
547563
getEkmConfigSettings,
548564
updateEkmConfigSettings,
565+
verifyConnectivitySettings,
549566
listLocationsSettings,
550567
getLocationSettings,
551568
setIamPolicySettings,
@@ -610,6 +627,11 @@ private static Builder initDefaults(Builder builder) {
610627
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
611628
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
612629

630+
builder
631+
.verifyConnectivitySettings()
632+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
633+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
634+
613635
builder
614636
.listLocationsSettings()
615637
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
@@ -688,6 +710,12 @@ public UnaryCallSettings.Builder<UpdateEkmConfigRequest, EkmConfig> updateEkmCon
688710
return updateEkmConfigSettings;
689711
}
690712

713+
/** Returns the builder for the settings used for calls to verifyConnectivity. */
714+
public UnaryCallSettings.Builder<VerifyConnectivityRequest, VerifyConnectivityResponse>
715+
verifyConnectivitySettings() {
716+
return verifyConnectivitySettings;
717+
}
718+
691719
/** Returns the builder for the settings used for calls to listLocations. */
692720
public PagedCallSettings.Builder<
693721
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

0 commit comments

Comments
 (0)