Skip to content

Commit 06497ad

Browse files
feat: [alloydb] support for obtaining the public IP address of an Instance (#10439)
- [ ] Regenerate this pull request now. feat: support for getting PSC DNS name from the GetConnectionInfo API feat: add PSC cluster and instance configuration settings to enable/disable PSC and obtain the PSC endpoint name feat: add new API to list the databases in a project and location docs: clarified read pool config is for read pool type instances PiperOrigin-RevId: 610475013 Source-Link: https://togithub.com/googleapis/googleapis/commit/aa16fdad909bc33e2d4ff04cfde56a46d0e52b13 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/9ccc90ecbf45d8b065b520597fabb64fd415678d Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiI5Y2NjOTBlY2JmNDVkOGIwNjViNTIwNTk3ZmFiYjY0ZmQ0MTU2NzhkIn0= BEGIN_NESTED_COMMIT feat: [alloydb] support for obtaining the public IP address of an Instance feat: support for getting PSC DNS name from the GetConnectionInfo API PiperOrigin-RevId: 610415824 Source-Link: https://togithub.com/googleapis/googleapis/commit/0733fdb5f745192f9f3c95f8d08039286567cbcc Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/49fd8e089feda5d293d18802548db52c3fbfb70c Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiI0OWZkOGUwODlmZWRhNWQyOTNkMTg4MDI1NDhkYjUyYzNmYmZiNzBjIn0= END_NESTED_COMMIT
1 parent 73bd736 commit 06497ad

49 files changed

Lines changed: 18035 additions & 4549 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

java-alloydb/README.md

Lines changed: 2 additions & 2 deletions
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.32.0</version>
26+
<version>26.33.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-alloydb/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-alloydb.svg
204-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.24.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.25.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-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminClient.java

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,26 @@
670670
* </td>
671671
* </tr>
672672
* <tr>
673+
* <td><p> ListDatabases</td>
674+
* <td><p> Lists Databases in a given project and location.</td>
675+
* <td>
676+
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
677+
* <ul>
678+
* <li><p> listDatabases(ListDatabasesRequest request)
679+
* </ul>
680+
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
681+
* <ul>
682+
* <li><p> listDatabases(ClusterName parent)
683+
* <li><p> listDatabases(String parent)
684+
* </ul>
685+
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
686+
* <ul>
687+
* <li><p> listDatabasesPagedCallable()
688+
* <li><p> listDatabasesCallable()
689+
* </ul>
690+
* </td>
691+
* </tr>
692+
* <tr>
673693
* <td><p> ListLocations</td>
674694
* <td><p> Lists information about the supported locations for this service.</td>
675695
* <td>
@@ -5278,6 +5298,171 @@ public final UnaryCallable<DeleteUserRequest, Empty> deleteUserCallable() {
52785298
return stub.deleteUserCallable();
52795299
}
52805300

5301+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
5302+
/**
5303+
* Lists Databases in a given project and location.
5304+
*
5305+
* <p>Sample code:
5306+
*
5307+
* <pre>{@code
5308+
* // This snippet has been automatically generated and should be regarded as a code template only.
5309+
* // It will require modifications to work:
5310+
* // - It may require correct/in-range values for request initialization.
5311+
* // - It may require specifying regional endpoints when creating the service client as shown in
5312+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5313+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
5314+
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
5315+
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
5316+
* // doThingsWith(element);
5317+
* }
5318+
* }
5319+
* }</pre>
5320+
*
5321+
* @param parent Required. Parent value for ListDatabasesRequest.
5322+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
5323+
*/
5324+
public final ListDatabasesPagedResponse listDatabases(ClusterName parent) {
5325+
ListDatabasesRequest request =
5326+
ListDatabasesRequest.newBuilder()
5327+
.setParent(parent == null ? null : parent.toString())
5328+
.build();
5329+
return listDatabases(request);
5330+
}
5331+
5332+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
5333+
/**
5334+
* Lists Databases in a given project and location.
5335+
*
5336+
* <p>Sample code:
5337+
*
5338+
* <pre>{@code
5339+
* // This snippet has been automatically generated and should be regarded as a code template only.
5340+
* // It will require modifications to work:
5341+
* // - It may require correct/in-range values for request initialization.
5342+
* // - It may require specifying regional endpoints when creating the service client as shown in
5343+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5344+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
5345+
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
5346+
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
5347+
* // doThingsWith(element);
5348+
* }
5349+
* }
5350+
* }</pre>
5351+
*
5352+
* @param parent Required. Parent value for ListDatabasesRequest.
5353+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
5354+
*/
5355+
public final ListDatabasesPagedResponse listDatabases(String parent) {
5356+
ListDatabasesRequest request = ListDatabasesRequest.newBuilder().setParent(parent).build();
5357+
return listDatabases(request);
5358+
}
5359+
5360+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
5361+
/**
5362+
* Lists Databases in a given project and location.
5363+
*
5364+
* <p>Sample code:
5365+
*
5366+
* <pre>{@code
5367+
* // This snippet has been automatically generated and should be regarded as a code template only.
5368+
* // It will require modifications to work:
5369+
* // - It may require correct/in-range values for request initialization.
5370+
* // - It may require specifying regional endpoints when creating the service client as shown in
5371+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5372+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
5373+
* ListDatabasesRequest request =
5374+
* ListDatabasesRequest.newBuilder()
5375+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
5376+
* .setPageSize(883849137)
5377+
* .setPageToken("pageToken873572522")
5378+
* .setFilter("filter-1274492040")
5379+
* .build();
5380+
* for (Database element : alloyDBAdminClient.listDatabases(request).iterateAll()) {
5381+
* // doThingsWith(element);
5382+
* }
5383+
* }
5384+
* }</pre>
5385+
*
5386+
* @param request The request object containing all of the parameters for the API call.
5387+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
5388+
*/
5389+
public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest request) {
5390+
return listDatabasesPagedCallable().call(request);
5391+
}
5392+
5393+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
5394+
/**
5395+
* Lists Databases in a given project and location.
5396+
*
5397+
* <p>Sample code:
5398+
*
5399+
* <pre>{@code
5400+
* // This snippet has been automatically generated and should be regarded as a code template only.
5401+
* // It will require modifications to work:
5402+
* // - It may require correct/in-range values for request initialization.
5403+
* // - It may require specifying regional endpoints when creating the service client as shown in
5404+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5405+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
5406+
* ListDatabasesRequest request =
5407+
* ListDatabasesRequest.newBuilder()
5408+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
5409+
* .setPageSize(883849137)
5410+
* .setPageToken("pageToken873572522")
5411+
* .setFilter("filter-1274492040")
5412+
* .build();
5413+
* ApiFuture<Database> future =
5414+
* alloyDBAdminClient.listDatabasesPagedCallable().futureCall(request);
5415+
* // Do something.
5416+
* for (Database element : future.get().iterateAll()) {
5417+
* // doThingsWith(element);
5418+
* }
5419+
* }
5420+
* }</pre>
5421+
*/
5422+
public final UnaryCallable<ListDatabasesRequest, ListDatabasesPagedResponse>
5423+
listDatabasesPagedCallable() {
5424+
return stub.listDatabasesPagedCallable();
5425+
}
5426+
5427+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
5428+
/**
5429+
* Lists Databases in a given project and location.
5430+
*
5431+
* <p>Sample code:
5432+
*
5433+
* <pre>{@code
5434+
* // This snippet has been automatically generated and should be regarded as a code template only.
5435+
* // It will require modifications to work:
5436+
* // - It may require correct/in-range values for request initialization.
5437+
* // - It may require specifying regional endpoints when creating the service client as shown in
5438+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
5439+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
5440+
* ListDatabasesRequest request =
5441+
* ListDatabasesRequest.newBuilder()
5442+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
5443+
* .setPageSize(883849137)
5444+
* .setPageToken("pageToken873572522")
5445+
* .setFilter("filter-1274492040")
5446+
* .build();
5447+
* while (true) {
5448+
* ListDatabasesResponse response = alloyDBAdminClient.listDatabasesCallable().call(request);
5449+
* for (Database element : response.getDatabasesList()) {
5450+
* // doThingsWith(element);
5451+
* }
5452+
* String nextPageToken = response.getNextPageToken();
5453+
* if (!Strings.isNullOrEmpty(nextPageToken)) {
5454+
* request = request.toBuilder().setPageToken(nextPageToken).build();
5455+
* } else {
5456+
* break;
5457+
* }
5458+
* }
5459+
* }
5460+
* }</pre>
5461+
*/
5462+
public final UnaryCallable<ListDatabasesRequest, ListDatabasesResponse> listDatabasesCallable() {
5463+
return stub.listDatabasesCallable();
5464+
}
5465+
52815466
// AUTO-GENERATED DOCUMENTATION AND METHOD.
52825467
/**
52835468
* Lists information about the supported locations for this service.
@@ -5848,6 +6033,82 @@ protected ListUsersFixedSizeCollection createCollection(
58486033
}
58496034
}
58506035

6036+
public static class ListDatabasesPagedResponse
6037+
extends AbstractPagedListResponse<
6038+
ListDatabasesRequest,
6039+
ListDatabasesResponse,
6040+
Database,
6041+
ListDatabasesPage,
6042+
ListDatabasesFixedSizeCollection> {
6043+
6044+
public static ApiFuture<ListDatabasesPagedResponse> createAsync(
6045+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
6046+
ApiFuture<ListDatabasesResponse> futureResponse) {
6047+
ApiFuture<ListDatabasesPage> futurePage =
6048+
ListDatabasesPage.createEmptyPage().createPageAsync(context, futureResponse);
6049+
return ApiFutures.transform(
6050+
futurePage,
6051+
input -> new ListDatabasesPagedResponse(input),
6052+
MoreExecutors.directExecutor());
6053+
}
6054+
6055+
private ListDatabasesPagedResponse(ListDatabasesPage page) {
6056+
super(page, ListDatabasesFixedSizeCollection.createEmptyCollection());
6057+
}
6058+
}
6059+
6060+
public static class ListDatabasesPage
6061+
extends AbstractPage<
6062+
ListDatabasesRequest, ListDatabasesResponse, Database, ListDatabasesPage> {
6063+
6064+
private ListDatabasesPage(
6065+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
6066+
ListDatabasesResponse response) {
6067+
super(context, response);
6068+
}
6069+
6070+
private static ListDatabasesPage createEmptyPage() {
6071+
return new ListDatabasesPage(null, null);
6072+
}
6073+
6074+
@Override
6075+
protected ListDatabasesPage createPage(
6076+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
6077+
ListDatabasesResponse response) {
6078+
return new ListDatabasesPage(context, response);
6079+
}
6080+
6081+
@Override
6082+
public ApiFuture<ListDatabasesPage> createPageAsync(
6083+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
6084+
ApiFuture<ListDatabasesResponse> futureResponse) {
6085+
return super.createPageAsync(context, futureResponse);
6086+
}
6087+
}
6088+
6089+
public static class ListDatabasesFixedSizeCollection
6090+
extends AbstractFixedSizeCollection<
6091+
ListDatabasesRequest,
6092+
ListDatabasesResponse,
6093+
Database,
6094+
ListDatabasesPage,
6095+
ListDatabasesFixedSizeCollection> {
6096+
6097+
private ListDatabasesFixedSizeCollection(List<ListDatabasesPage> pages, int collectionSize) {
6098+
super(pages, collectionSize);
6099+
}
6100+
6101+
private static ListDatabasesFixedSizeCollection createEmptyCollection() {
6102+
return new ListDatabasesFixedSizeCollection(null, 0);
6103+
}
6104+
6105+
@Override
6106+
protected ListDatabasesFixedSizeCollection createCollection(
6107+
List<ListDatabasesPage> pages, int collectionSize) {
6108+
return new ListDatabasesFixedSizeCollection(pages, collectionSize);
6109+
}
6110+
}
6111+
58516112
public static class ListLocationsPagedResponse
58526113
extends AbstractPagedListResponse<
58536114
ListLocationsRequest,

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/AlloyDBAdminSettings.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse;
2020
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse;
21+
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListDatabasesPagedResponse;
2122
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse;
2223
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse;
2324
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
@@ -357,6 +358,12 @@ public UnaryCallSettings<DeleteUserRequest, Empty> deleteUserSettings() {
357358
return ((AlloyDBAdminStubSettings) getStubSettings()).deleteUserSettings();
358359
}
359360

361+
/** Returns the object with the settings used for calls to listDatabases. */
362+
public PagedCallSettings<ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
363+
listDatabasesSettings() {
364+
return ((AlloyDBAdminStubSettings) getStubSettings()).listDatabasesSettings();
365+
}
366+
360367
/** Returns the object with the settings used for calls to listLocations. */
361368
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
362369
listLocationsSettings() {
@@ -759,6 +766,13 @@ public UnaryCallSettings.Builder<DeleteUserRequest, Empty> deleteUserSettings()
759766
return getStubSettingsBuilder().deleteUserSettings();
760767
}
761768

769+
/** Returns the builder for the settings used for calls to listDatabases. */
770+
public PagedCallSettings.Builder<
771+
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
772+
listDatabasesSettings() {
773+
return getStubSettingsBuilder().listDatabasesSettings();
774+
}
775+
762776
/** Returns the builder for the settings used for calls to listLocations. */
763777
public PagedCallSettings.Builder<
764778
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"ListClusters": {
7777
"methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"]
7878
},
79+
"ListDatabases": {
80+
"methods": ["listDatabases", "listDatabases", "listDatabases", "listDatabasesPagedCallable", "listDatabasesCallable"]
81+
},
7982
"ListInstances": {
8083
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
8184
},

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1beta/stub/AlloyDBAdminStub.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListBackupsPagedResponse;
2020
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListClustersPagedResponse;
21+
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListDatabasesPagedResponse;
2122
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListInstancesPagedResponse;
2223
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListLocationsPagedResponse;
2324
import static com.google.cloud.alloydb.v1beta.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
@@ -56,6 +57,8 @@
5657
import com.google.cloud.alloydb.v1beta.ListBackupsResponse;
5758
import com.google.cloud.alloydb.v1beta.ListClustersRequest;
5859
import com.google.cloud.alloydb.v1beta.ListClustersResponse;
60+
import com.google.cloud.alloydb.v1beta.ListDatabasesRequest;
61+
import com.google.cloud.alloydb.v1beta.ListDatabasesResponse;
5962
import com.google.cloud.alloydb.v1beta.ListInstancesRequest;
6063
import com.google.cloud.alloydb.v1beta.ListInstancesResponse;
6164
import com.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest;
@@ -338,6 +341,15 @@ public UnaryCallable<DeleteUserRequest, Empty> deleteUserCallable() {
338341
throw new UnsupportedOperationException("Not implemented: deleteUserCallable()");
339342
}
340343

344+
public UnaryCallable<ListDatabasesRequest, ListDatabasesPagedResponse>
345+
listDatabasesPagedCallable() {
346+
throw new UnsupportedOperationException("Not implemented: listDatabasesPagedCallable()");
347+
}
348+
349+
public UnaryCallable<ListDatabasesRequest, ListDatabasesResponse> listDatabasesCallable() {
350+
throw new UnsupportedOperationException("Not implemented: listDatabasesCallable()");
351+
}
352+
341353
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
342354
listLocationsPagedCallable() {
343355
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");

0 commit comments

Comments
 (0)