Skip to content
Permalink
Browse files
feat(spanner): add progress field to UpdateDatabaseDdlMetadata (#…
…1063)

PiperOrigin-RevId: 368426665

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Apr 14 07:34:31 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 3b236df084cf9222c529a2890f90e3a4ff0f2dfd
Source-Link: googleapis/googleapis@3b236df
  • Loading branch information
yoshi-automation committed Apr 15, 2021
1 parent f997333 commit 7992342bffc273ad8249e7564ae9ef51764bf83c
Showing with 2,691 additions and 2,068 deletions.
  1. +69 −12 ...e-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
  2. +19 −6 ...oud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
  3. +48 −64 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java
  4. +66 −111 ...le-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
  5. +60 −72 ...loud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java
  6. +15 −18 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java
  7. +18 −30 ...spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
  8. +73 −70 ...oud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
  9. +32 −29 ...oud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java
  10. +20 −22 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupEncryptionConfig.java
  11. +4 −4 ...-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupEncryptionConfigOrBuilder.java
  12. +12 −24 ...er-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java
  13. +3 −6 ...database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java
  14. +62 −64 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java
  15. +15 −15 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java
  16. +26 −28 ...r-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java
  17. +6 −6 ...atabase-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java
  18. +14 −14 ...-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
  19. +4 −4 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java
  20. +2 −4 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java
  21. +2 −4 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DropDatabaseRequest.java
  22. +50 −50 ...-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/EncryptionInfo.java
  23. +13 −13 ...admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/EncryptionInfoOrBuilder.java
  24. +2 −4 ...panner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java
  25. +2 −4 ...r-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetDatabaseDdlRequest.java
  26. +2 −4 ...-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetDatabaseDdlResponse.java
  27. +2 −4 ...nner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetDatabaseRequest.java
  28. +28 −56 ...n-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java
  29. +8 −16 ...e-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java
  30. +115 −115 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java
  31. +25 −25 ...-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java
  32. +30 −53 ...nner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java
  33. +8 −14 ...n-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java
  34. +16 −18 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java
  35. +4 −4 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java
  36. +28 −56 ...database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java
  37. +8 −16 ...v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java
  38. +16 −25 ...er-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabasesRequest.java
  39. +4 −6 ...database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabasesRequestOrBuilder.java
  40. +16 −18 ...r-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabasesResponse.java
  41. +4 −4 ...atabase-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabasesResponseOrBuilder.java
  42. +30 −32 ...tabase-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseEncryptionConfig.java
  43. +8 −8 .../src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseEncryptionConfigOrBuilder.java
  44. +40 −52 ...admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java
  45. +11 −14 ...abase-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java
  46. +72 −72 ...-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java
  47. +18 −18 ...tabase-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java
  48. +155 −153 ...min-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
  49. +2 −4 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java
  50. +663 −0 ...min-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateDatabaseDdlMetadata.java
  51. +87 −0 ...ase-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateDatabaseDdlMetadataOrBuilder.java
  52. +46 −60 ...dmin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateDatabaseDdlRequest.java
  53. +12 −16 ...base-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateDatabaseDdlRequestOrBuilder.java
  54. +68 −88 ...ogle-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto
  55. +9 −9 ...ogle-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto
  56. +91 −117 ...er-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
  57. +11 −11 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitResponse.java
  58. +1 −1 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitResponseOrBuilder.java
  59. +92 −0 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/CommitResponseProto.java
  60. +42 −28 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RequestOptions.java
  61. +12 −8 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/RequestOptionsOrBuilder.java
  62. +207 −235 proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
  63. +52 −0 proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/commit_response.proto
  64. +7 −28 proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto
  65. +4 −2 synth.metadata
@@ -980,7 +980,9 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* ResourceName resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
* Policy policy = Policy.newBuilder().build();
* Policy response = databaseAdminClient.setIamPolicy(resource, policy);
* }
@@ -1015,7 +1017,10 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
* String resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
* .toString();
* Policy policy = Policy.newBuilder().build();
* Policy response = databaseAdminClient.setIamPolicy(resource, policy);
* }
@@ -1049,7 +1054,14 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .setPolicy(Policy.newBuilder().build())
* .build();
* Policy response = databaseAdminClient.setIamPolicy(request);
@@ -1078,7 +1090,14 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .setPolicy(Policy.newBuilder().build())
* .build();
* ApiFuture<Policy> future = databaseAdminClient.setIamPolicyCallable().futureCall(request);
@@ -1105,7 +1124,9 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* ResourceName resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
* Policy response = databaseAdminClient.getIamPolicy(resource);
* }
* }</pre>
@@ -1136,7 +1157,10 @@ public final Policy getIamPolicy(ResourceName resource) {
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
* String resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
* .toString();
* Policy response = databaseAdminClient.getIamPolicy(resource);
* }
* }</pre>
@@ -1166,7 +1190,14 @@ public final Policy getIamPolicy(String resource) {
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = databaseAdminClient.getIamPolicy(request);
@@ -1196,7 +1227,14 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture<Policy> future = databaseAdminClient.getIamPolicyCallable().futureCall(request);
@@ -1223,7 +1261,9 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* ResourceName resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsResponse response =
* databaseAdminClient.testIamPermissions(resource, permissions);
@@ -1261,7 +1301,10 @@ public final TestIamPermissionsResponse testIamPermissions(
*
* <pre>{@code
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* String resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString();
* String resource =
* CryptoKeyVersionName.of(
* "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
* .toString();
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsResponse response =
* databaseAdminClient.testIamPermissions(resource, permissions);
@@ -1301,7 +1344,14 @@ public final TestIamPermissionsResponse testIamPermissions(
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* TestIamPermissionsResponse response = databaseAdminClient.testIamPermissions(request);
@@ -1331,7 +1381,14 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString())
* .setResource(
* CryptoKeyVersionName.of(
* "[PROJECT]",
* "[LOCATION]",
* "[KEY_RING]",
* "[CRYPTO_KEY]",
* "[CRYPTO_KEY_VERSION]")
* .toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* ApiFuture<TestIamPermissionsResponse> future =
@@ -48,6 +48,7 @@
import com.google.spanner.admin.database.v1.BackupName;
import com.google.spanner.admin.database.v1.CreateBackupRequest;
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
import com.google.spanner.admin.database.v1.CryptoKeyVersionName;
import com.google.spanner.admin.database.v1.Database;
import com.google.spanner.admin.database.v1.DatabaseName;
import com.google.spanner.admin.database.v1.DeleteBackupRequest;
@@ -650,7 +651,9 @@ public void setIamPolicyTest() throws Exception {
.build();
mockDatabaseAdmin.addResponse(expectedResponse);

ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
Policy policy = Policy.newBuilder().build();

Policy actualResponse = client.setIamPolicy(resource, policy);
@@ -674,7 +677,9 @@ public void setIamPolicyExceptionTest() throws Exception {
mockDatabaseAdmin.addException(exception);

try {
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
Policy policy = Policy.newBuilder().build();
client.setIamPolicy(resource, policy);
Assert.fail("No exception raised");
@@ -736,7 +741,9 @@ public void getIamPolicyTest() throws Exception {
.build();
mockDatabaseAdmin.addResponse(expectedResponse);

ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");

Policy actualResponse = client.getIamPolicy(resource);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -758,7 +765,9 @@ public void getIamPolicyExceptionTest() throws Exception {
mockDatabaseAdmin.addException(exception);

try {
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
client.getIamPolicy(resource);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -812,7 +821,9 @@ public void testIamPermissionsTest() throws Exception {
TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList<String>()).build();
mockDatabaseAdmin.addResponse(expectedResponse);

ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
List<String> permissions = new ArrayList<>();

TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions);
@@ -836,7 +847,9 @@ public void testIamPermissionsExceptionTest() throws Exception {
mockDatabaseAdmin.addException(exception);

try {
ResourceName resource = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]");
ResourceName resource =
CryptoKeyVersionName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
List<String> permissions = new ArrayList<>();
client.testIamPermissions(resource, permissions);
Assert.fail("No exception raised");

0 comments on commit 7992342

Please sign in to comment.