Skip to content

Commit 24577d1

Browse files
feat: [alloydb] added PSC config, PSC interface config, PSC instance config (#10166)
* feat: added PSC config, PSC interface config, PSC instance config feat: added two boolean fields satisfies_pzi and satisfies_pzs feat: added instance network config feat: added ListDatabases API and Database object feat: changed field network in NetworkConfig from required to optional docs: clarified read pool config is for read pool type instances PiperOrigin-RevId: 591902051 Source-Link: googleapis/googleapis@5e74f9d Source-Link: https://github.com/googleapis/googleapis-gen/commit/be1a83a2d59d4ac303271db236f3cc229d804415 Copy-Tag: eyJwIjoiamF2YS1hbGxveWRiLy5Pd2xCb3QueWFtbCIsImgiOiJiZTFhODNhMmQ1OWQ0YWMzMDMyNzFkYjIzNmYzY2MyMjlkODA0NDE1In0= * 🦉 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 04b5953 commit 24577d1

41 files changed

Lines changed: 16448 additions & 2976 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.19.0
204+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.21.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/v1alpha/AlloyDBAdminClient.java

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4657,6 +4657,171 @@ public final UnaryCallable<DeleteUserRequest, Empty> deleteUserCallable() {
46574657
return stub.deleteUserCallable();
46584658
}
46594659

4660+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
4661+
/**
4662+
* Lists Databases in a given project and location.
4663+
*
4664+
* <p>Sample code:
4665+
*
4666+
* <pre>{@code
4667+
* // This snippet has been automatically generated and should be regarded as a code template only.
4668+
* // It will require modifications to work:
4669+
* // - It may require correct/in-range values for request initialization.
4670+
* // - It may require specifying regional endpoints when creating the service client as shown in
4671+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4672+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
4673+
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
4674+
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
4675+
* // doThingsWith(element);
4676+
* }
4677+
* }
4678+
* }</pre>
4679+
*
4680+
* @param parent Required. Parent value for ListDatabasesRequest.
4681+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
4682+
*/
4683+
public final ListDatabasesPagedResponse listDatabases(ClusterName parent) {
4684+
ListDatabasesRequest request =
4685+
ListDatabasesRequest.newBuilder()
4686+
.setParent(parent == null ? null : parent.toString())
4687+
.build();
4688+
return listDatabases(request);
4689+
}
4690+
4691+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
4692+
/**
4693+
* Lists Databases in a given project and location.
4694+
*
4695+
* <p>Sample code:
4696+
*
4697+
* <pre>{@code
4698+
* // This snippet has been automatically generated and should be regarded as a code template only.
4699+
* // It will require modifications to work:
4700+
* // - It may require correct/in-range values for request initialization.
4701+
* // - It may require specifying regional endpoints when creating the service client as shown in
4702+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4703+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
4704+
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
4705+
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
4706+
* // doThingsWith(element);
4707+
* }
4708+
* }
4709+
* }</pre>
4710+
*
4711+
* @param parent Required. Parent value for ListDatabasesRequest.
4712+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
4713+
*/
4714+
public final ListDatabasesPagedResponse listDatabases(String parent) {
4715+
ListDatabasesRequest request = ListDatabasesRequest.newBuilder().setParent(parent).build();
4716+
return listDatabases(request);
4717+
}
4718+
4719+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
4720+
/**
4721+
* Lists Databases in a given project and location.
4722+
*
4723+
* <p>Sample code:
4724+
*
4725+
* <pre>{@code
4726+
* // This snippet has been automatically generated and should be regarded as a code template only.
4727+
* // It will require modifications to work:
4728+
* // - It may require correct/in-range values for request initialization.
4729+
* // - It may require specifying regional endpoints when creating the service client as shown in
4730+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4731+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
4732+
* ListDatabasesRequest request =
4733+
* ListDatabasesRequest.newBuilder()
4734+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
4735+
* .setPageSize(883849137)
4736+
* .setPageToken("pageToken873572522")
4737+
* .setFilter("filter-1274492040")
4738+
* .build();
4739+
* for (Database element : alloyDBAdminClient.listDatabases(request).iterateAll()) {
4740+
* // doThingsWith(element);
4741+
* }
4742+
* }
4743+
* }</pre>
4744+
*
4745+
* @param request The request object containing all of the parameters for the API call.
4746+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
4747+
*/
4748+
public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest request) {
4749+
return listDatabasesPagedCallable().call(request);
4750+
}
4751+
4752+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
4753+
/**
4754+
* Lists Databases in a given project and location.
4755+
*
4756+
* <p>Sample code:
4757+
*
4758+
* <pre>{@code
4759+
* // This snippet has been automatically generated and should be regarded as a code template only.
4760+
* // It will require modifications to work:
4761+
* // - It may require correct/in-range values for request initialization.
4762+
* // - It may require specifying regional endpoints when creating the service client as shown in
4763+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4764+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
4765+
* ListDatabasesRequest request =
4766+
* ListDatabasesRequest.newBuilder()
4767+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
4768+
* .setPageSize(883849137)
4769+
* .setPageToken("pageToken873572522")
4770+
* .setFilter("filter-1274492040")
4771+
* .build();
4772+
* ApiFuture<Database> future =
4773+
* alloyDBAdminClient.listDatabasesPagedCallable().futureCall(request);
4774+
* // Do something.
4775+
* for (Database element : future.get().iterateAll()) {
4776+
* // doThingsWith(element);
4777+
* }
4778+
* }
4779+
* }</pre>
4780+
*/
4781+
public final UnaryCallable<ListDatabasesRequest, ListDatabasesPagedResponse>
4782+
listDatabasesPagedCallable() {
4783+
return stub.listDatabasesPagedCallable();
4784+
}
4785+
4786+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
4787+
/**
4788+
* Lists Databases in a given project and location.
4789+
*
4790+
* <p>Sample code:
4791+
*
4792+
* <pre>{@code
4793+
* // This snippet has been automatically generated and should be regarded as a code template only.
4794+
* // It will require modifications to work:
4795+
* // - It may require correct/in-range values for request initialization.
4796+
* // - It may require specifying regional endpoints when creating the service client as shown in
4797+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
4798+
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
4799+
* ListDatabasesRequest request =
4800+
* ListDatabasesRequest.newBuilder()
4801+
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
4802+
* .setPageSize(883849137)
4803+
* .setPageToken("pageToken873572522")
4804+
* .setFilter("filter-1274492040")
4805+
* .build();
4806+
* while (true) {
4807+
* ListDatabasesResponse response = alloyDBAdminClient.listDatabasesCallable().call(request);
4808+
* for (Database element : response.getDatabasesList()) {
4809+
* // doThingsWith(element);
4810+
* }
4811+
* String nextPageToken = response.getNextPageToken();
4812+
* if (!Strings.isNullOrEmpty(nextPageToken)) {
4813+
* request = request.toBuilder().setPageToken(nextPageToken).build();
4814+
* } else {
4815+
* break;
4816+
* }
4817+
* }
4818+
* }
4819+
* }</pre>
4820+
*/
4821+
public final UnaryCallable<ListDatabasesRequest, ListDatabasesResponse> listDatabasesCallable() {
4822+
return stub.listDatabasesCallable();
4823+
}
4824+
46604825
// AUTO-GENERATED DOCUMENTATION AND METHOD.
46614826
/**
46624827
* Lists information about the supported locations for this service.
@@ -5227,6 +5392,82 @@ protected ListUsersFixedSizeCollection createCollection(
52275392
}
52285393
}
52295394

5395+
public static class ListDatabasesPagedResponse
5396+
extends AbstractPagedListResponse<
5397+
ListDatabasesRequest,
5398+
ListDatabasesResponse,
5399+
Database,
5400+
ListDatabasesPage,
5401+
ListDatabasesFixedSizeCollection> {
5402+
5403+
public static ApiFuture<ListDatabasesPagedResponse> createAsync(
5404+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
5405+
ApiFuture<ListDatabasesResponse> futureResponse) {
5406+
ApiFuture<ListDatabasesPage> futurePage =
5407+
ListDatabasesPage.createEmptyPage().createPageAsync(context, futureResponse);
5408+
return ApiFutures.transform(
5409+
futurePage,
5410+
input -> new ListDatabasesPagedResponse(input),
5411+
MoreExecutors.directExecutor());
5412+
}
5413+
5414+
private ListDatabasesPagedResponse(ListDatabasesPage page) {
5415+
super(page, ListDatabasesFixedSizeCollection.createEmptyCollection());
5416+
}
5417+
}
5418+
5419+
public static class ListDatabasesPage
5420+
extends AbstractPage<
5421+
ListDatabasesRequest, ListDatabasesResponse, Database, ListDatabasesPage> {
5422+
5423+
private ListDatabasesPage(
5424+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
5425+
ListDatabasesResponse response) {
5426+
super(context, response);
5427+
}
5428+
5429+
private static ListDatabasesPage createEmptyPage() {
5430+
return new ListDatabasesPage(null, null);
5431+
}
5432+
5433+
@Override
5434+
protected ListDatabasesPage createPage(
5435+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
5436+
ListDatabasesResponse response) {
5437+
return new ListDatabasesPage(context, response);
5438+
}
5439+
5440+
@Override
5441+
public ApiFuture<ListDatabasesPage> createPageAsync(
5442+
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
5443+
ApiFuture<ListDatabasesResponse> futureResponse) {
5444+
return super.createPageAsync(context, futureResponse);
5445+
}
5446+
}
5447+
5448+
public static class ListDatabasesFixedSizeCollection
5449+
extends AbstractFixedSizeCollection<
5450+
ListDatabasesRequest,
5451+
ListDatabasesResponse,
5452+
Database,
5453+
ListDatabasesPage,
5454+
ListDatabasesFixedSizeCollection> {
5455+
5456+
private ListDatabasesFixedSizeCollection(List<ListDatabasesPage> pages, int collectionSize) {
5457+
super(pages, collectionSize);
5458+
}
5459+
5460+
private static ListDatabasesFixedSizeCollection createEmptyCollection() {
5461+
return new ListDatabasesFixedSizeCollection(null, 0);
5462+
}
5463+
5464+
@Override
5465+
protected ListDatabasesFixedSizeCollection createCollection(
5466+
List<ListDatabasesPage> pages, int collectionSize) {
5467+
return new ListDatabasesFixedSizeCollection(pages, collectionSize);
5468+
}
5469+
}
5470+
52305471
public static class ListLocationsPagedResponse
52315472
extends AbstractPagedListResponse<
52325473
ListLocationsRequest,

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/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.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse;
2020
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse;
21+
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListDatabasesPagedResponse;
2122
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse;
2223
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse;
2324
import static com.google.cloud.alloydb.v1alpha.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() {
@@ -760,6 +767,13 @@ public UnaryCallSettings.Builder<DeleteUserRequest, Empty> deleteUserSettings()
760767
return getStubSettingsBuilder().deleteUserSettings();
761768
}
762769

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

java-alloydb/google-cloud-alloydb/src/main/java/com/google/cloud/alloydb/v1alpha/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/v1alpha/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.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse;
2020
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse;
21+
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListDatabasesPagedResponse;
2122
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse;
2223
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse;
2324
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
@@ -56,6 +57,8 @@
5657
import com.google.cloud.alloydb.v1alpha.ListBackupsResponse;
5758
import com.google.cloud.alloydb.v1alpha.ListClustersRequest;
5859
import com.google.cloud.alloydb.v1alpha.ListClustersResponse;
60+
import com.google.cloud.alloydb.v1alpha.ListDatabasesRequest;
61+
import com.google.cloud.alloydb.v1alpha.ListDatabasesResponse;
5962
import com.google.cloud.alloydb.v1alpha.ListInstancesRequest;
6063
import com.google.cloud.alloydb.v1alpha.ListInstancesResponse;
6164
import com.google.cloud.alloydb.v1alpha.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)