Skip to content

Commit

Permalink
chore: autogenerated updates (#1206)
Browse files Browse the repository at this point in the history
* feat: AuditConfig for IAM v1

PiperOrigin-RevId: 439356405

Source-Link: googleapis/googleapis@afa2ba1

Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e40c17e1510c95fab58fc2143ccb61cceca5989
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2U0MGMxN2UxNTEwYzk1ZmFiNThmYzIxNDNjY2I2MWNjZWNhNTk4OSJ9

docs: Update `cpu_utilization_percent` limit
docs: Remove the limitation of all clusters in a CMEK instance must use the same key

PiperOrigin-RevId: 438385300

Source-Link: googleapis/googleapis@c59f02e

Source-Link: https://github.com/googleapis/googleapis-gen/commit/04d03d17aafa7b4422f73c93600f040542817fcd
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDRkMDNkMTdhYWZhN2I0NDIyZjczYzkzNjAwZjA0MDU0MjgxN2ZjZCJ9

feat: Add ListHotTablets API method and protobufs

PiperOrigin-RevId: 436758628

Source-Link: googleapis/googleapis@92ab86a

Source-Link: https://github.com/googleapis/googleapis-gen/commit/931ef114d5f845abf117bf8e0a29836ca300b694
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMxZWYxMTRkNWY4NDVhYmYxMTdiZjhlMGEyOTgzNmNhMzAwYjY5NCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore(bazel): update version of Protobuf to v3.20.1

PiperOrigin-RevId: 444328399

Source-Link: googleapis/googleapis@c7ca416

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d61705453a62b3ecda78aa30c192840ebc5a8a90
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDYxNzA1NDUzYTYyYjNlY2RhNzhhYTMwYzE5Mjg0MGViYzVhOGE5MCJ9

* 🦉 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] authored Apr 27, 2022
1 parent 4c96d48 commit f127f1a
Show file tree
Hide file tree
Showing 118 changed files with 6,500 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@
import com.google.bigtable.admin.v2.GetAppProfileRequest;
import com.google.bigtable.admin.v2.GetClusterRequest;
import com.google.bigtable.admin.v2.GetInstanceRequest;
import com.google.bigtable.admin.v2.HotTablet;
import com.google.bigtable.admin.v2.Instance;
import com.google.bigtable.admin.v2.InstanceName;
import com.google.bigtable.admin.v2.ListAppProfilesRequest;
import com.google.bigtable.admin.v2.ListAppProfilesResponse;
import com.google.bigtable.admin.v2.ListClustersRequest;
import com.google.bigtable.admin.v2.ListClustersResponse;
import com.google.bigtable.admin.v2.ListHotTabletsRequest;
import com.google.bigtable.admin.v2.ListHotTabletsResponse;
import com.google.bigtable.admin.v2.ListInstancesRequest;
import com.google.bigtable.admin.v2.ListInstancesResponse;
import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata;
Expand Down Expand Up @@ -2279,6 +2282,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = baseBigtableInstanceAdminClient.setIamPolicy(request);
* }
Expand All @@ -2304,6 +2308,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future =
* baseBigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
Expand Down Expand Up @@ -2434,6 +2439,166 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
return stub.testIamPermissionsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
* on CPU usage.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* for (HotTablet element :
* baseBigtableInstanceAdminClient.listHotTablets(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The cluster name to list hot tablets. Value is in the following form:
* `projects/{project}/instances/{instance}/clusters/{cluster}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListHotTabletsPagedResponse listHotTablets(ClusterName parent) {
ListHotTabletsRequest request =
ListHotTabletsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listHotTablets(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
* on CPU usage.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
* for (HotTablet element :
* baseBigtableInstanceAdminClient.listHotTablets(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The cluster name to list hot tablets. Value is in the following form:
* `projects/{project}/instances/{instance}/clusters/{cluster}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListHotTabletsPagedResponse listHotTablets(String parent) {
ListHotTabletsRequest request = ListHotTabletsRequest.newBuilder().setParent(parent).build();
return listHotTablets(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
* on CPU usage.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* ListHotTabletsRequest request =
* ListHotTabletsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
* .setStartTime(Timestamp.newBuilder().build())
* .setEndTime(Timestamp.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (HotTablet element :
* baseBigtableInstanceAdminClient.listHotTablets(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 ListHotTabletsPagedResponse listHotTablets(ListHotTabletsRequest request) {
return listHotTabletsPagedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
* on CPU usage.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* ListHotTabletsRequest request =
* ListHotTabletsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
* .setStartTime(Timestamp.newBuilder().build())
* .setEndTime(Timestamp.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<HotTablet> future =
* baseBigtableInstanceAdminClient.listHotTabletsPagedCallable().futureCall(request);
* // Do something.
* for (HotTablet element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*/
public final UnaryCallable<ListHotTabletsRequest, ListHotTabletsPagedResponse>
listHotTabletsPagedCallable() {
return stub.listHotTabletsPagedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
* on CPU usage.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* ListHotTabletsRequest request =
* ListHotTabletsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
* .setStartTime(Timestamp.newBuilder().build())
* .setEndTime(Timestamp.newBuilder().build())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListHotTabletsResponse response =
* baseBigtableInstanceAdminClient.listHotTabletsCallable().call(request);
* for (HotTablet element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }</pre>
*/
public final UnaryCallable<ListHotTabletsRequest, ListHotTabletsResponse>
listHotTabletsCallable() {
return stub.listHotTabletsCallable();
}

@Override
public final void close() {
stub.close();
Expand Down Expand Up @@ -2540,4 +2705,80 @@ protected ListAppProfilesFixedSizeCollection createCollection(
return new ListAppProfilesFixedSizeCollection(pages, collectionSize);
}
}

public static class ListHotTabletsPagedResponse
extends AbstractPagedListResponse<
ListHotTabletsRequest,
ListHotTabletsResponse,
HotTablet,
ListHotTabletsPage,
ListHotTabletsFixedSizeCollection> {

public static ApiFuture<ListHotTabletsPagedResponse> createAsync(
PageContext<ListHotTabletsRequest, ListHotTabletsResponse, HotTablet> context,
ApiFuture<ListHotTabletsResponse> futureResponse) {
ApiFuture<ListHotTabletsPage> futurePage =
ListHotTabletsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListHotTabletsPagedResponse(input),
MoreExecutors.directExecutor());
}

private ListHotTabletsPagedResponse(ListHotTabletsPage page) {
super(page, ListHotTabletsFixedSizeCollection.createEmptyCollection());
}
}

public static class ListHotTabletsPage
extends AbstractPage<
ListHotTabletsRequest, ListHotTabletsResponse, HotTablet, ListHotTabletsPage> {

private ListHotTabletsPage(
PageContext<ListHotTabletsRequest, ListHotTabletsResponse, HotTablet> context,
ListHotTabletsResponse response) {
super(context, response);
}

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

@Override
protected ListHotTabletsPage createPage(
PageContext<ListHotTabletsRequest, ListHotTabletsResponse, HotTablet> context,
ListHotTabletsResponse response) {
return new ListHotTabletsPage(context, response);
}

@Override
public ApiFuture<ListHotTabletsPage> createPageAsync(
PageContext<ListHotTabletsRequest, ListHotTabletsResponse, HotTablet> context,
ApiFuture<ListHotTabletsResponse> futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}

public static class ListHotTabletsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListHotTabletsRequest,
ListHotTabletsResponse,
HotTablet,
ListHotTabletsPage,
ListHotTabletsFixedSizeCollection> {

private ListHotTabletsFixedSizeCollection(List<ListHotTabletsPage> pages, int collectionSize) {
super(pages, collectionSize);
}

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

@Override
protected ListHotTabletsFixedSizeCollection createCollection(
List<ListHotTabletsPage> pages, int collectionSize) {
return new ListHotTabletsFixedSizeCollection(pages, collectionSize);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.bigtable.admin.v2;

import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse;
import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
Expand Down Expand Up @@ -49,6 +50,8 @@
import com.google.bigtable.admin.v2.ListAppProfilesResponse;
import com.google.bigtable.admin.v2.ListClustersRequest;
import com.google.bigtable.admin.v2.ListClustersResponse;
import com.google.bigtable.admin.v2.ListHotTabletsRequest;
import com.google.bigtable.admin.v2.ListHotTabletsResponse;
import com.google.bigtable.admin.v2.ListInstancesRequest;
import com.google.bigtable.admin.v2.ListInstancesResponse;
import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata;
Expand Down Expand Up @@ -216,6 +219,13 @@ public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return ((BigtableInstanceAdminStubSettings) getStubSettings()).testIamPermissionsSettings();
}

/** Returns the object with the settings used for calls to listHotTablets. */
public PagedCallSettings<
ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse>
listHotTabletsSettings() {
return ((BigtableInstanceAdminStubSettings) getStubSettings()).listHotTabletsSettings();
}

public static final BaseBigtableInstanceAdminSettings create(
BigtableInstanceAdminStubSettings stub) throws IOException {
return new BaseBigtableInstanceAdminSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -457,6 +467,13 @@ public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettin
return getStubSettingsBuilder().testIamPermissionsSettings();
}

/** Returns the builder for the settings used for calls to listHotTablets. */
public PagedCallSettings.Builder<
ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse>
listHotTabletsSettings() {
return getStubSettingsBuilder().listHotTabletsSettings();
}

@Override
public BaseBigtableInstanceAdminSettings build() throws IOException {
return new BaseBigtableInstanceAdminSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2887,6 +2887,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = baseBigtableTableAdminClient.setIamPolicy(request);
* }
Expand All @@ -2912,6 +2913,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future =
* baseBigtableTableAdminClient.setIamPolicyCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"ListClusters": {
"methods": ["listClusters", "listClusters", "listClusters", "listClustersCallable"]
},
"ListHotTablets": {
"methods": ["listHotTablets", "listHotTablets", "listHotTablets", "listHotTabletsPagedCallable", "listHotTabletsCallable"]
},
"ListInstances": {
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.bigtable.admin.v2.stub;

import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListAppProfilesPagedResponse;
import static com.google.cloud.bigtable.admin.v2.BaseBigtableInstanceAdminClient.ListHotTabletsPagedResponse;

import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
Expand All @@ -40,6 +41,8 @@
import com.google.bigtable.admin.v2.ListAppProfilesResponse;
import com.google.bigtable.admin.v2.ListClustersRequest;
import com.google.bigtable.admin.v2.ListClustersResponse;
import com.google.bigtable.admin.v2.ListHotTabletsRequest;
import com.google.bigtable.admin.v2.ListHotTabletsResponse;
import com.google.bigtable.admin.v2.ListInstancesRequest;
import com.google.bigtable.admin.v2.ListInstancesResponse;
import com.google.bigtable.admin.v2.PartialUpdateClusterMetadata;
Expand Down Expand Up @@ -187,6 +190,15 @@ public UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()");
}

public UnaryCallable<ListHotTabletsRequest, ListHotTabletsPagedResponse>
listHotTabletsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listHotTabletsPagedCallable()");
}

public UnaryCallable<ListHotTabletsRequest, ListHotTabletsResponse> listHotTabletsCallable() {
throw new UnsupportedOperationException("Not implemented: listHotTabletsCallable()");
}

@Override
public abstract void close();
}
Loading

0 comments on commit f127f1a

Please sign in to comment.