Skip to content

Commit

Permalink
feat: [alloydb] added PSC config, PSC interface config, PSC instance …
Browse files Browse the repository at this point in the history
…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: googleapis/googleapis-gen@be1a83a
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 2, 2024
1 parent 04b5953 commit 24577d1
Show file tree
Hide file tree
Showing 41 changed files with 16,448 additions and 2,976 deletions.
2 changes: 1 addition & 1 deletion java-alloydb/README.md
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.19.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-alloydb/0.21.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
Expand Up @@ -4657,6 +4657,171 @@ public final UnaryCallable<DeleteUserRequest, Empty> deleteUserCallable() {
return stub.deleteUserCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Databases in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. Parent value for ListDatabasesRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListDatabasesPagedResponse listDatabases(ClusterName parent) {
ListDatabasesRequest request =
ListDatabasesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listDatabases(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Databases in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* for (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. Parent value for ListDatabasesRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListDatabasesPagedResponse listDatabases(String parent) {
ListDatabasesRequest request = ListDatabasesRequest.newBuilder().setParent(parent).build();
return listDatabases(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Databases in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
* ListDatabasesRequest request =
* ListDatabasesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* for (Database element : alloyDBAdminClient.listDatabases(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest request) {
return listDatabasesPagedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Databases in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
* ListDatabasesRequest request =
* ListDatabasesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* ApiFuture<Database> future =
* alloyDBAdminClient.listDatabasesPagedCallable().futureCall(request);
* // Do something.
* for (Database element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*/
public final UnaryCallable<ListDatabasesRequest, ListDatabasesPagedResponse>
listDatabasesPagedCallable() {
return stub.listDatabasesPagedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Databases in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
* ListDatabasesRequest request =
* ListDatabasesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* while (true) {
* ListDatabasesResponse response = alloyDBAdminClient.listDatabasesCallable().call(request);
* for (Database element : response.getDatabasesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }</pre>
*/
public final UnaryCallable<ListDatabasesRequest, ListDatabasesResponse> listDatabasesCallable() {
return stub.listDatabasesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down Expand Up @@ -5227,6 +5392,82 @@ protected ListUsersFixedSizeCollection createCollection(
}
}

public static class ListDatabasesPagedResponse
extends AbstractPagedListResponse<
ListDatabasesRequest,
ListDatabasesResponse,
Database,
ListDatabasesPage,
ListDatabasesFixedSizeCollection> {

public static ApiFuture<ListDatabasesPagedResponse> createAsync(
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
ApiFuture<ListDatabasesResponse> futureResponse) {
ApiFuture<ListDatabasesPage> futurePage =
ListDatabasesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListDatabasesPagedResponse(input),
MoreExecutors.directExecutor());
}

private ListDatabasesPagedResponse(ListDatabasesPage page) {
super(page, ListDatabasesFixedSizeCollection.createEmptyCollection());
}
}

public static class ListDatabasesPage
extends AbstractPage<
ListDatabasesRequest, ListDatabasesResponse, Database, ListDatabasesPage> {

private ListDatabasesPage(
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
ListDatabasesResponse response) {
super(context, response);
}

private static ListDatabasesPage createEmptyPage() {
return new ListDatabasesPage(null, null);
}

@Override
protected ListDatabasesPage createPage(
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
ListDatabasesResponse response) {
return new ListDatabasesPage(context, response);
}

@Override
public ApiFuture<ListDatabasesPage> createPageAsync(
PageContext<ListDatabasesRequest, ListDatabasesResponse, Database> context,
ApiFuture<ListDatabasesResponse> futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}

public static class ListDatabasesFixedSizeCollection
extends AbstractFixedSizeCollection<
ListDatabasesRequest,
ListDatabasesResponse,
Database,
ListDatabasesPage,
ListDatabasesFixedSizeCollection> {

private ListDatabasesFixedSizeCollection(List<ListDatabasesPage> pages, int collectionSize) {
super(pages, collectionSize);
}

private static ListDatabasesFixedSizeCollection createEmptyCollection() {
return new ListDatabasesFixedSizeCollection(null, 0);
}

@Override
protected ListDatabasesFixedSizeCollection createCollection(
List<ListDatabasesPage> pages, int collectionSize) {
return new ListDatabasesFixedSizeCollection(pages, collectionSize);
}
}

public static class ListLocationsPagedResponse
extends AbstractPagedListResponse<
ListLocationsRequest,
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListDatabasesPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
Expand Down Expand Up @@ -357,6 +358,12 @@ public UnaryCallSettings<DeleteUserRequest, Empty> deleteUserSettings() {
return ((AlloyDBAdminStubSettings) getStubSettings()).deleteUserSettings();
}

/** Returns the object with the settings used for calls to listDatabases. */
public PagedCallSettings<ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
listDatabasesSettings() {
return ((AlloyDBAdminStubSettings) getStubSettings()).listDatabasesSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -760,6 +767,13 @@ public UnaryCallSettings.Builder<DeleteUserRequest, Empty> deleteUserSettings()
return getStubSettingsBuilder().deleteUserSettings();
}

/** Returns the builder for the settings used for calls to listDatabases. */
public PagedCallSettings.Builder<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
listDatabasesSettings() {
return getStubSettingsBuilder().listDatabasesSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Expand Up @@ -76,6 +76,9 @@
"ListClusters": {
"methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"]
},
"ListDatabases": {
"methods": ["listDatabases", "listDatabases", "listDatabases", "listDatabasesPagedCallable", "listDatabasesCallable"]
},
"ListInstances": {
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
},
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListClustersPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListDatabasesPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListInstancesPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListLocationsPagedResponse;
import static com.google.cloud.alloydb.v1alpha.AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse;
Expand Down Expand Up @@ -56,6 +57,8 @@
import com.google.cloud.alloydb.v1alpha.ListBackupsResponse;
import com.google.cloud.alloydb.v1alpha.ListClustersRequest;
import com.google.cloud.alloydb.v1alpha.ListClustersResponse;
import com.google.cloud.alloydb.v1alpha.ListDatabasesRequest;
import com.google.cloud.alloydb.v1alpha.ListDatabasesResponse;
import com.google.cloud.alloydb.v1alpha.ListInstancesRequest;
import com.google.cloud.alloydb.v1alpha.ListInstancesResponse;
import com.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest;
Expand Down Expand Up @@ -338,6 +341,15 @@ public UnaryCallable<DeleteUserRequest, Empty> deleteUserCallable() {
throw new UnsupportedOperationException("Not implemented: deleteUserCallable()");
}

public UnaryCallable<ListDatabasesRequest, ListDatabasesPagedResponse>
listDatabasesPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listDatabasesPagedCallable()");
}

public UnaryCallable<ListDatabasesRequest, ListDatabasesResponse> listDatabasesCallable() {
throw new UnsupportedOperationException("Not implemented: listDatabasesCallable()");
}

public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
Expand Down

0 comments on commit 24577d1

Please sign in to comment.