Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [alloydb] add metadata exchange support for AlloyDB connectors #9639

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions java-alloydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.17.0</version>
<version>26.18.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -45,20 +45,20 @@ If you are using Maven without the BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-alloydb</artifactId>
<version>0.10.0</version>
<version>0.9.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-alloydb:0.10.0'
implementation 'com.google.cloud:google-cloud-alloydb:0.9.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-alloydb" % "0.10.0"
libraryDependencies += "com.google.cloud" % "google-cloud-alloydb" % "0.9.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-alloydb/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-alloydb.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.8.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.9.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3788,9 +3788,9 @@ public final ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to
* support the Auth Proxy client and the endpoint's behavior is subject to change without notice,
* so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy
* client.
* support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to
* change without notice, so do not rely on its behavior remaining constant. Future changes will
* not break AlloyDB connectors or the Auth Proxy client.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -3822,9 +3822,9 @@ public final GenerateClientCertificateResponse generateClientCertificate(Cluster
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to
* support the Auth Proxy client and the endpoint's behavior is subject to change without notice,
* so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy
* client.
* support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to
* change without notice, so do not rely on its behavior remaining constant. Future changes will
* not break AlloyDB connectors or the Auth Proxy client.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -3854,9 +3854,9 @@ public final GenerateClientCertificateResponse generateClientCertificate(String
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to
* support the Auth Proxy client and the endpoint's behavior is subject to change without notice,
* so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy
* client.
* support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to
* change without notice, so do not rely on its behavior remaining constant. Future changes will
* not break AlloyDB connectors or the Auth Proxy client.
*
* <p>Sample code:
*
Expand All @@ -3874,6 +3874,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(String
* .setPemCsr("pemCsr-991911478")
* .setCertDuration(Duration.newBuilder().build())
* .setPublicKey("publicKey1446899510")
* .setUseMetadataExchange(true)
* .build();
* GenerateClientCertificateResponse response =
* alloyDBAdminClient.generateClientCertificate(request);
Expand All @@ -3891,9 +3892,9 @@ public final GenerateClientCertificateResponse generateClientCertificate(
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to
* support the Auth Proxy client and the endpoint's behavior is subject to change without notice,
* so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy
* client.
* support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to
* change without notice, so do not rely on its behavior remaining constant. Future changes will
* not break AlloyDB connectors or the Auth Proxy client.
*
* <p>Sample code:
*
Expand All @@ -3911,6 +3912,7 @@ public final GenerateClientCertificateResponse generateClientCertificate(
* .setPemCsr("pemCsr-991911478")
* .setCertDuration(Duration.newBuilder().build())
* .setPublicKey("publicKey1446899510")
* .setUseMetadataExchange(true)
* .build();
* ApiFuture<GenerateClientCertificateResponse> future =
* alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public void getClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -283,6 +284,7 @@ public void getClusterTest2() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -348,6 +350,7 @@ public void createClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -422,6 +425,7 @@ public void createClusterTest2() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -496,6 +500,7 @@ public void updateClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -529,6 +534,7 @@ public void updateClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -582,6 +588,7 @@ public void updateClusterExceptionTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateClusterAsync(cluster, updateMask).get();
Expand Down Expand Up @@ -706,6 +713,7 @@ public void promoteClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -776,6 +784,7 @@ public void promoteClusterTest2() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -846,6 +855,7 @@ public void restoreClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -930,6 +940,7 @@ public void createSecondaryClusterTest() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1004,6 +1015,7 @@ public void createSecondaryClusterTest2() throws Exception {
.setContinuousBackupInfo(ContinuousBackupInfo.newBuilder().build())
.setSecondaryConfig(Cluster.SecondaryConfig.newBuilder().build())
.setPrimaryConfig(Cluster.PrimaryConfig.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1176,6 +1188,7 @@ public void getInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -1239,6 +1252,7 @@ public void getInstanceTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -1304,6 +1318,7 @@ public void createInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1376,6 +1391,7 @@ public void createInstanceTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1448,6 +1464,7 @@ public void createSecondaryInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1521,6 +1538,7 @@ public void createSecondaryInstanceTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1653,6 +1671,7 @@ public void updateInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1684,6 +1703,7 @@ public void updateInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -1735,6 +1755,7 @@ public void updateInstanceExceptionTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateInstanceAsync(instance, updateMask).get();
Expand Down Expand Up @@ -1859,6 +1880,7 @@ public void failoverInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1927,6 +1949,7 @@ public void failoverInstanceTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -1997,6 +2020,7 @@ public void injectFaultTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2067,6 +2091,7 @@ public void injectFaultTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2139,6 +2164,7 @@ public void restartInstanceTest() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2207,6 +2233,7 @@ public void restartInstanceTest2() throws Exception {
.setEtag("etag3123477")
.putAllAnnotations(new HashMap<String, String>())
.setUpdatePolicy(Instance.UpdatePolicy.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2374,6 +2401,8 @@ public void getBackupTest() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -2434,6 +2463,8 @@ public void getBackupTest2() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -2494,6 +2525,8 @@ public void createBackupTest() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2563,6 +2596,8 @@ public void createBackupTest2() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2632,6 +2667,8 @@ public void updateBackupTest() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -2660,6 +2697,8 @@ public void updateBackupTest() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -2708,6 +2747,8 @@ public void updateBackupExceptionTest() throws Exception {
.putAllAnnotations(new HashMap<String, String>())
.setSizeBytes(-1796325715)
.setExpiryTime(Timestamp.newBuilder().build())
.setExpiryQuantity(Backup.QuantityBasedExpiry.newBuilder().build())
.setSatisfiesPzs(true)
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateBackupAsync(backup, updateMask).get();
Expand Down