Skip to content

Commit a4c6621

Browse files
chore: googleapis updates (#1290)
BEGIN_COMMIT_OVERRIDE feat(generated): Cloud Bigtable Undelete Table service and message proto files feat(generated): Add storage_utilization_gib_per_node to Autoscaling target END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 458022604 Source-Link: googleapis/googleapis@e5507fc Source-Link: https://github.com/googleapis/googleapis-gen/commit/2c26a744087ad06367adb44649c93b772f97cc24 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmMyNmE3NDQwODdhZDA2MzY3YWRiNDQ2NDljOTNiNzcyZjk3Y2MyNCJ9
1 parent e0bd6c9 commit a4c6621

21 files changed

+3056
-296
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java

+133
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
import com.google.bigtable.admin.v2.SnapshotTableRequest;
6464
import com.google.bigtable.admin.v2.Table;
6565
import com.google.bigtable.admin.v2.TableName;
66+
import com.google.bigtable.admin.v2.UndeleteTableMetadata;
67+
import com.google.bigtable.admin.v2.UndeleteTableRequest;
6668
import com.google.bigtable.admin.v2.UpdateBackupRequest;
6769
import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStub;
6870
import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings;
@@ -940,6 +942,137 @@ public final UnaryCallable<DeleteTableRequest, Empty> deleteTableCallable() {
940942
return stub.deleteTableCallable();
941943
}
942944

945+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
946+
/**
947+
* Restores a specified table which was accidentally deleted.
948+
*
949+
* <p>Sample code:
950+
*
951+
* <pre>{@code
952+
* // This snippet has been automatically generated for illustrative purposes only.
953+
* // It may require modifications to work in your environment.
954+
* try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
955+
* BaseBigtableTableAdminClient.create()) {
956+
* TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
957+
* Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
958+
* }
959+
* }</pre>
960+
*
961+
* @param name Required. The unique name of the table to be restored. Values are of the form
962+
* `projects/{project}/instances/{instance}/tables/{table}`.
963+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
964+
*/
965+
public final OperationFuture<Table, UndeleteTableMetadata> undeleteTableAsync(TableName name) {
966+
UndeleteTableRequest request =
967+
UndeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
968+
return undeleteTableAsync(request);
969+
}
970+
971+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
972+
/**
973+
* Restores a specified table which was accidentally deleted.
974+
*
975+
* <p>Sample code:
976+
*
977+
* <pre>{@code
978+
* // This snippet has been automatically generated for illustrative purposes only.
979+
* // It may require modifications to work in your environment.
980+
* try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
981+
* BaseBigtableTableAdminClient.create()) {
982+
* String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
983+
* Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
984+
* }
985+
* }</pre>
986+
*
987+
* @param name Required. The unique name of the table to be restored. Values are of the form
988+
* `projects/{project}/instances/{instance}/tables/{table}`.
989+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
990+
*/
991+
public final OperationFuture<Table, UndeleteTableMetadata> undeleteTableAsync(String name) {
992+
UndeleteTableRequest request = UndeleteTableRequest.newBuilder().setName(name).build();
993+
return undeleteTableAsync(request);
994+
}
995+
996+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
997+
/**
998+
* Restores a specified table which was accidentally deleted.
999+
*
1000+
* <p>Sample code:
1001+
*
1002+
* <pre>{@code
1003+
* // This snippet has been automatically generated for illustrative purposes only.
1004+
* // It may require modifications to work in your environment.
1005+
* try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
1006+
* BaseBigtableTableAdminClient.create()) {
1007+
* UndeleteTableRequest request =
1008+
* UndeleteTableRequest.newBuilder()
1009+
* .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
1010+
* .build();
1011+
* Table response = baseBigtableTableAdminClient.undeleteTableAsync(request).get();
1012+
* }
1013+
* }</pre>
1014+
*
1015+
* @param request The request object containing all of the parameters for the API call.
1016+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1017+
*/
1018+
public final OperationFuture<Table, UndeleteTableMetadata> undeleteTableAsync(
1019+
UndeleteTableRequest request) {
1020+
return undeleteTableOperationCallable().futureCall(request);
1021+
}
1022+
1023+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1024+
/**
1025+
* Restores a specified table which was accidentally deleted.
1026+
*
1027+
* <p>Sample code:
1028+
*
1029+
* <pre>{@code
1030+
* // This snippet has been automatically generated for illustrative purposes only.
1031+
* // It may require modifications to work in your environment.
1032+
* try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
1033+
* BaseBigtableTableAdminClient.create()) {
1034+
* UndeleteTableRequest request =
1035+
* UndeleteTableRequest.newBuilder()
1036+
* .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
1037+
* .build();
1038+
* OperationFuture<Table, UndeleteTableMetadata> future =
1039+
* baseBigtableTableAdminClient.undeleteTableOperationCallable().futureCall(request);
1040+
* // Do something.
1041+
* Table response = future.get();
1042+
* }
1043+
* }</pre>
1044+
*/
1045+
public final OperationCallable<UndeleteTableRequest, Table, UndeleteTableMetadata>
1046+
undeleteTableOperationCallable() {
1047+
return stub.undeleteTableOperationCallable();
1048+
}
1049+
1050+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1051+
/**
1052+
* Restores a specified table which was accidentally deleted.
1053+
*
1054+
* <p>Sample code:
1055+
*
1056+
* <pre>{@code
1057+
* // This snippet has been automatically generated for illustrative purposes only.
1058+
* // It may require modifications to work in your environment.
1059+
* try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
1060+
* BaseBigtableTableAdminClient.create()) {
1061+
* UndeleteTableRequest request =
1062+
* UndeleteTableRequest.newBuilder()
1063+
* .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
1064+
* .build();
1065+
* ApiFuture<Operation> future =
1066+
* baseBigtableTableAdminClient.undeleteTableCallable().futureCall(request);
1067+
* // Do something.
1068+
* Operation response = future.get();
1069+
* }
1070+
* }</pre>
1071+
*/
1072+
public final UnaryCallable<UndeleteTableRequest, Operation> undeleteTableCallable() {
1073+
return stub.undeleteTableCallable();
1074+
}
1075+
9431076
// AUTO-GENERATED DOCUMENTATION AND METHOD.
9441077
/**
9451078
* Performs a series of column family modifications on the specified table. Either all or none of

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java

+24
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
import com.google.bigtable.admin.v2.SnapshotTableMetadata;
6464
import com.google.bigtable.admin.v2.SnapshotTableRequest;
6565
import com.google.bigtable.admin.v2.Table;
66+
import com.google.bigtable.admin.v2.UndeleteTableMetadata;
67+
import com.google.bigtable.admin.v2.UndeleteTableRequest;
6668
import com.google.bigtable.admin.v2.UpdateBackupRequest;
6769
import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStubSettings;
6870
import com.google.iam.v1.GetIamPolicyRequest;
@@ -117,6 +119,17 @@ public UnaryCallSettings<DeleteTableRequest, Empty> deleteTableSettings() {
117119
return ((BigtableTableAdminStubSettings) getStubSettings()).deleteTableSettings();
118120
}
119121

122+
/** Returns the object with the settings used for calls to undeleteTable. */
123+
public UnaryCallSettings<UndeleteTableRequest, Operation> undeleteTableSettings() {
124+
return ((BigtableTableAdminStubSettings) getStubSettings()).undeleteTableSettings();
125+
}
126+
127+
/** Returns the object with the settings used for calls to undeleteTable. */
128+
public OperationCallSettings<UndeleteTableRequest, Table, UndeleteTableMetadata>
129+
undeleteTableOperationSettings() {
130+
return ((BigtableTableAdminStubSettings) getStubSettings()).undeleteTableOperationSettings();
131+
}
132+
120133
/** Returns the object with the settings used for calls to modifyColumnFamilies. */
121134
public UnaryCallSettings<ModifyColumnFamiliesRequest, Table> modifyColumnFamiliesSettings() {
122135
return ((BigtableTableAdminStubSettings) getStubSettings()).modifyColumnFamiliesSettings();
@@ -357,6 +370,17 @@ public UnaryCallSettings.Builder<DeleteTableRequest, Empty> deleteTableSettings(
357370
return getStubSettingsBuilder().deleteTableSettings();
358371
}
359372

373+
/** Returns the builder for the settings used for calls to undeleteTable. */
374+
public UnaryCallSettings.Builder<UndeleteTableRequest, Operation> undeleteTableSettings() {
375+
return getStubSettingsBuilder().undeleteTableSettings();
376+
}
377+
378+
/** Returns the builder for the settings used for calls to undeleteTable. */
379+
public OperationCallSettings.Builder<UndeleteTableRequest, Table, UndeleteTableMetadata>
380+
undeleteTableOperationSettings() {
381+
return getStubSettingsBuilder().undeleteTableOperationSettings();
382+
}
383+
360384
/** Returns the builder for the settings used for calls to modifyColumnFamilies. */
361385
public UnaryCallSettings.Builder<ModifyColumnFamiliesRequest, Table>
362386
modifyColumnFamiliesSettings() {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public String toString() {
120120
.add("restoreTableSettings", stubSettings.restoreTableSettings())
121121
.add("restoreTableOperationSettings", stubSettings.restoreTableOperationSettings())
122122
.add("stubSettings", stubSettings)
123+
.add("undeleteTableSettings", stubSettings.undeleteTableSettings())
124+
.add("undeleteTableOperationSettings", stubSettings.undeleteTableOperationSettings())
123125
.toString();
124126
}
125127

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
"TestIamPermissions": {
146146
"methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"]
147147
},
148+
"UndeleteTable": {
149+
"methods": ["undeleteTableAsync", "undeleteTableAsync", "undeleteTableAsync", "undeleteTableOperationCallable", "undeleteTableCallable"]
150+
},
148151
"UpdateBackup": {
149152
"methods": ["updateBackup", "updateBackup", "updateBackupCallable"]
150153
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
import com.google.bigtable.admin.v2.SnapshotTableMetadata;
5555
import com.google.bigtable.admin.v2.SnapshotTableRequest;
5656
import com.google.bigtable.admin.v2.Table;
57+
import com.google.bigtable.admin.v2.UndeleteTableMetadata;
58+
import com.google.bigtable.admin.v2.UndeleteTableRequest;
5759
import com.google.bigtable.admin.v2.UpdateBackupRequest;
5860
import com.google.iam.v1.GetIamPolicyRequest;
5961
import com.google.iam.v1.Policy;
@@ -106,6 +108,15 @@ public UnaryCallable<DeleteTableRequest, Empty> deleteTableCallable() {
106108
throw new UnsupportedOperationException("Not implemented: deleteTableCallable()");
107109
}
108110

111+
public OperationCallable<UndeleteTableRequest, Table, UndeleteTableMetadata>
112+
undeleteTableOperationCallable() {
113+
throw new UnsupportedOperationException("Not implemented: undeleteTableOperationCallable()");
114+
}
115+
116+
public UnaryCallable<UndeleteTableRequest, Operation> undeleteTableCallable() {
117+
throw new UnsupportedOperationException("Not implemented: undeleteTableCallable()");
118+
}
119+
109120
public UnaryCallable<ModifyColumnFamiliesRequest, Table> modifyColumnFamiliesCallable() {
110121
throw new UnsupportedOperationException("Not implemented: modifyColumnFamiliesCallable()");
111122
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java

+69
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
import com.google.bigtable.admin.v2.SnapshotTableMetadata;
7777
import com.google.bigtable.admin.v2.SnapshotTableRequest;
7878
import com.google.bigtable.admin.v2.Table;
79+
import com.google.bigtable.admin.v2.UndeleteTableMetadata;
80+
import com.google.bigtable.admin.v2.UndeleteTableRequest;
7981
import com.google.bigtable.admin.v2.UpdateBackupRequest;
8082
import com.google.common.collect.ImmutableList;
8183
import com.google.common.collect.ImmutableMap;
@@ -151,6 +153,9 @@ public class BigtableTableAdminStubSettings extends StubSettings<BigtableTableAd
151153
listTablesSettings;
152154
private final UnaryCallSettings<GetTableRequest, Table> getTableSettings;
153155
private final UnaryCallSettings<DeleteTableRequest, Empty> deleteTableSettings;
156+
private final UnaryCallSettings<UndeleteTableRequest, Operation> undeleteTableSettings;
157+
private final OperationCallSettings<UndeleteTableRequest, Table, UndeleteTableMetadata>
158+
undeleteTableOperationSettings;
154159
private final UnaryCallSettings<ModifyColumnFamiliesRequest, Table> modifyColumnFamiliesSettings;
155160
private final UnaryCallSettings<DropRowRangeRequest, Empty> dropRowRangeSettings;
156161
private final UnaryCallSettings<GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse>
@@ -374,6 +379,17 @@ public UnaryCallSettings<DeleteTableRequest, Empty> deleteTableSettings() {
374379
return deleteTableSettings;
375380
}
376381

382+
/** Returns the object with the settings used for calls to undeleteTable. */
383+
public UnaryCallSettings<UndeleteTableRequest, Operation> undeleteTableSettings() {
384+
return undeleteTableSettings;
385+
}
386+
387+
/** Returns the object with the settings used for calls to undeleteTable. */
388+
public OperationCallSettings<UndeleteTableRequest, Table, UndeleteTableMetadata>
389+
undeleteTableOperationSettings() {
390+
return undeleteTableOperationSettings;
391+
}
392+
377393
/** Returns the object with the settings used for calls to modifyColumnFamilies. */
378394
public UnaryCallSettings<ModifyColumnFamiliesRequest, Table> modifyColumnFamiliesSettings() {
379395
return modifyColumnFamiliesSettings;
@@ -564,6 +580,8 @@ protected BigtableTableAdminStubSettings(Builder settingsBuilder) throws IOExcep
564580
listTablesSettings = settingsBuilder.listTablesSettings().build();
565581
getTableSettings = settingsBuilder.getTableSettings().build();
566582
deleteTableSettings = settingsBuilder.deleteTableSettings().build();
583+
undeleteTableSettings = settingsBuilder.undeleteTableSettings().build();
584+
undeleteTableOperationSettings = settingsBuilder.undeleteTableOperationSettings().build();
567585
modifyColumnFamiliesSettings = settingsBuilder.modifyColumnFamiliesSettings().build();
568586
dropRowRangeSettings = settingsBuilder.dropRowRangeSettings().build();
569587
generateConsistencyTokenSettings = settingsBuilder.generateConsistencyTokenSettings().build();
@@ -601,6 +619,9 @@ public static class Builder
601619
listTablesSettings;
602620
private final UnaryCallSettings.Builder<GetTableRequest, Table> getTableSettings;
603621
private final UnaryCallSettings.Builder<DeleteTableRequest, Empty> deleteTableSettings;
622+
private final UnaryCallSettings.Builder<UndeleteTableRequest, Operation> undeleteTableSettings;
623+
private final OperationCallSettings.Builder<UndeleteTableRequest, Table, UndeleteTableMetadata>
624+
undeleteTableOperationSettings;
604625
private final UnaryCallSettings.Builder<ModifyColumnFamiliesRequest, Table>
605626
modifyColumnFamiliesSettings;
606627
private final UnaryCallSettings.Builder<DropRowRangeRequest, Empty> dropRowRangeSettings;
@@ -729,6 +750,8 @@ protected Builder(ClientContext clientContext) {
729750
listTablesSettings = PagedCallSettings.newBuilder(LIST_TABLES_PAGE_STR_FACT);
730751
getTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
731752
deleteTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
753+
undeleteTableSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
754+
undeleteTableOperationSettings = OperationCallSettings.newBuilder();
732755
modifyColumnFamiliesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
733756
dropRowRangeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
734757
generateConsistencyTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -757,6 +780,7 @@ protected Builder(ClientContext clientContext) {
757780
listTablesSettings,
758781
getTableSettings,
759782
deleteTableSettings,
783+
undeleteTableSettings,
760784
modifyColumnFamiliesSettings,
761785
dropRowRangeSettings,
762786
generateConsistencyTokenSettings,
@@ -787,6 +811,8 @@ protected Builder(BigtableTableAdminStubSettings settings) {
787811
listTablesSettings = settings.listTablesSettings.toBuilder();
788812
getTableSettings = settings.getTableSettings.toBuilder();
789813
deleteTableSettings = settings.deleteTableSettings.toBuilder();
814+
undeleteTableSettings = settings.undeleteTableSettings.toBuilder();
815+
undeleteTableOperationSettings = settings.undeleteTableOperationSettings.toBuilder();
790816
modifyColumnFamiliesSettings = settings.modifyColumnFamiliesSettings.toBuilder();
791817
dropRowRangeSettings = settings.dropRowRangeSettings.toBuilder();
792818
generateConsistencyTokenSettings = settings.generateConsistencyTokenSettings.toBuilder();
@@ -815,6 +841,7 @@ protected Builder(BigtableTableAdminStubSettings settings) {
815841
listTablesSettings,
816842
getTableSettings,
817843
deleteTableSettings,
844+
undeleteTableSettings,
818845
modifyColumnFamiliesSettings,
819846
dropRowRangeSettings,
820847
generateConsistencyTokenSettings,
@@ -873,6 +900,11 @@ private static Builder initDefaults(Builder builder) {
873900
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
874901
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
875902

903+
builder
904+
.undeleteTableSettings()
905+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
906+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
907+
876908
builder
877909
.modifyColumnFamiliesSettings()
878910
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
@@ -983,6 +1015,30 @@ private static Builder initDefaults(Builder builder) {
9831015
.setTotalTimeout(Duration.ofMillis(3600000L))
9841016
.build()));
9851017

1018+
builder
1019+
.undeleteTableOperationSettings()
1020+
.setInitialCallSettings(
1021+
UnaryCallSettings
1022+
.<UndeleteTableRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
1023+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
1024+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
1025+
.build())
1026+
.setResponseTransformer(
1027+
ProtoOperationTransformers.ResponseTransformer.create(Table.class))
1028+
.setMetadataTransformer(
1029+
ProtoOperationTransformers.MetadataTransformer.create(UndeleteTableMetadata.class))
1030+
.setPollingAlgorithm(
1031+
OperationTimedPollAlgorithm.create(
1032+
RetrySettings.newBuilder()
1033+
.setInitialRetryDelay(Duration.ofMillis(5000L))
1034+
.setRetryDelayMultiplier(1.5)
1035+
.setMaxRetryDelay(Duration.ofMillis(45000L))
1036+
.setInitialRpcTimeout(Duration.ZERO)
1037+
.setRpcTimeoutMultiplier(1.0)
1038+
.setMaxRpcTimeout(Duration.ZERO)
1039+
.setTotalTimeout(Duration.ofMillis(300000L))
1040+
.build()));
1041+
9861042
builder
9871043
.snapshotTableOperationSettings()
9881044
.setInitialCallSettings(
@@ -1109,6 +1165,19 @@ public UnaryCallSettings.Builder<DeleteTableRequest, Empty> deleteTableSettings(
11091165
return deleteTableSettings;
11101166
}
11111167

1168+
/** Returns the builder for the settings used for calls to undeleteTable. */
1169+
public UnaryCallSettings.Builder<UndeleteTableRequest, Operation> undeleteTableSettings() {
1170+
return undeleteTableSettings;
1171+
}
1172+
1173+
/** Returns the builder for the settings used for calls to undeleteTable. */
1174+
@BetaApi(
1175+
"The surface for use by generated code is not stable yet and may change in the future.")
1176+
public OperationCallSettings.Builder<UndeleteTableRequest, Table, UndeleteTableMetadata>
1177+
undeleteTableOperationSettings() {
1178+
return undeleteTableOperationSettings;
1179+
}
1180+
11121181
/** Returns the builder for the settings used for calls to modifyColumnFamilies. */
11131182
public UnaryCallSettings.Builder<ModifyColumnFamiliesRequest, Table>
11141183
modifyColumnFamiliesSettings() {

0 commit comments

Comments
 (0)