Skip to content
Permalink
Browse files
feat: add Backups protos and APIs (#97)
* feat: add Backups protos and APIs

* Ignore DatabaseOrBuilder interface change.

This is an auto-generated interface only intended to be used internally.

Co-authored-by: Shanika Kuruppu <skuruppu@google.com>
  • Loading branch information
yoshi-automation and skuruppu committed Mar 13, 2020
1 parent b9c141c commit 5643c22a4531dac75b9fac5b128eb714a27920a0
Showing with 32,199 additions and 308 deletions.
  1. +1,489 −37 ...e-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java
  2. +148 −0 ...cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java
  3. +2 −1 google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java
  4. +78 −0 ...loud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java
  5. +517 −0 ...nner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java
  6. +328 −0 ...-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java
  7. +413 −6 ...oud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClientTest.java
  8. +131 −0 ...cloud-spanner/src/test/java/com/google/cloud/spanner/admin/database/v1/MockDatabaseAdminImpl.java
  9. +1,350 −88 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseAdminGrpc.java
  10. +34 −0 proto-google-cloud-spanner-admin-database-v1/clirr-ignored-differences.xml
  11. +2,338 −0 ...le-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Backup.java
  12. +1,091 −0 ...loud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfo.java
  13. +113 −0 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupInfoOrBuilder.java
  14. +210 −0 ...loud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupName.java
  15. +321 −0 ...spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupOrBuilder.java
  16. +263 −0 ...oud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/BackupProto.java
  17. +80 −0 ...oud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CommonProto.java
  18. +1,491 −0 ...er-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadata.java
  19. +178 −0 ...database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupMetadataOrBuilder.java
  20. +1,173 −0 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequest.java
  21. +134 −0 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateBackupRequestOrBuilder.java
  22. +26 −26 ...r-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequest.java
  23. +8 −8 ...atabase-v1/src/main/java/com/google/spanner/admin/database/v1/CreateDatabaseRequestOrBuilder.java
  24. +663 −14 ...-cloud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/Database.java
  25. +90 −4 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DatabaseOrBuilder.java
  26. +663 −0 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequest.java
  27. +58 −0 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/DeleteBackupRequestOrBuilder.java
  28. +663 −0 ...panner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequest.java
  29. +58 −0 ...min-database-v1/src/main/java/com/google/spanner/admin/database/v1/GetBackupRequestOrBuilder.java
  30. +1,349 −0 ...n-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequest.java
  31. +188 −0 ...e-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsRequestOrBuilder.java
  32. +1,329 −0 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponse.java
  33. +145 −0 ...-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupOperationsResponseOrBuilder.java
  34. +1,312 −0 ...nner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequest.java
  35. +180 −0 ...n-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsRequestOrBuilder.java
  36. +1,159 −0 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponse.java
  37. +111 −0 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/ListBackupsResponseOrBuilder.java
  38. +1,367 −0 ...database-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequest.java
  39. +192 −0 ...v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsRequestOrBuilder.java
  40. +1,240 −0 ...atabase-v1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponse.java
  41. +125 −0 ...1/src/main/java/com/google/spanner/admin/database/v1/ListDatabaseOperationsResponseOrBuilder.java
  42. +1,093 −0 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgress.java
  43. +112 −0 ...in-database-v1/src/main/java/com/google/spanner/admin/database/v1/OperationProgressOrBuilder.java
  44. +929 −0 ...abase-v1/src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadata.java
  45. +85 −0 ...src/main/java/com/google/spanner/admin/database/v1/OptimizeRestoredDatabaseMetadataOrBuilder.java
  46. +2,105 −0 ...admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadata.java
  47. +264 −0 ...abase-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseMetadataOrBuilder.java
  48. +1,163 −0 ...-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequest.java
  49. +122 −0 ...tabase-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreDatabaseRequestOrBuilder.java
  50. +994 −0 ...oud-spanner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfo.java
  51. +90 −0 ...er-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreInfoOrBuilder.java
  52. +154 −0 ...anner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/RestoreSourceType.java
  53. +269 −108 ...min-database-v1/src/main/java/com/google/spanner/admin/database/v1/SpannerDatabaseAdminProto.java
  54. +1,120 −0 ...ner-admin-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequest.java
  55. +125 −0 ...-database-v1/src/main/java/com/google/spanner/admin/database/v1/UpdateBackupRequestOrBuilder.java
  56. +363 −0 ...ogle-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/backup.proto
  57. +43 −0 ...ogle-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/common.proto
  58. +354 −10 ...er-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
  59. +6 −6 synth.metadata

Large diffs are not rendered by default.

@@ -15,6 +15,9 @@
*/
package com.google.cloud.spanner.admin.database.v1;

import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse;

import com.google.api.core.ApiFunction;
@@ -37,15 +40,29 @@
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.spanner.admin.database.v1.Backup;
import com.google.spanner.admin.database.v1.CreateBackupMetadata;
import com.google.spanner.admin.database.v1.CreateBackupRequest;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
import com.google.spanner.admin.database.v1.Database;
import com.google.spanner.admin.database.v1.DeleteBackupRequest;
import com.google.spanner.admin.database.v1.DropDatabaseRequest;
import com.google.spanner.admin.database.v1.GetBackupRequest;
import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest;
import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse;
import com.google.spanner.admin.database.v1.GetDatabaseRequest;
import com.google.spanner.admin.database.v1.ListBackupOperationsRequest;
import com.google.spanner.admin.database.v1.ListBackupOperationsResponse;
import com.google.spanner.admin.database.v1.ListBackupsRequest;
import com.google.spanner.admin.database.v1.ListBackupsResponse;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse;
import com.google.spanner.admin.database.v1.ListDatabasesRequest;
import com.google.spanner.admin.database.v1.ListDatabasesResponse;
import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata;
import com.google.spanner.admin.database.v1.RestoreDatabaseRequest;
import com.google.spanner.admin.database.v1.UpdateBackupRequest;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest;
import java.io.IOException;
@@ -143,6 +160,71 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).testIamPermissionsSettings();
}

/** Returns the object with the settings used for calls to createBackup. */
public UnaryCallSettings<CreateBackupRequest, Operation> createBackupSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).createBackupSettings();
}

/** Returns the object with the settings used for calls to createBackup. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<CreateBackupRequest, Backup, CreateBackupMetadata>
createBackupOperationSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).createBackupOperationSettings();
}

/** Returns the object with the settings used for calls to getBackup. */
public UnaryCallSettings<GetBackupRequest, Backup> getBackupSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).getBackupSettings();
}

/** Returns the object with the settings used for calls to updateBackup. */
public UnaryCallSettings<UpdateBackupRequest, Backup> updateBackupSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).updateBackupSettings();
}

/** Returns the object with the settings used for calls to deleteBackup. */
public UnaryCallSettings<DeleteBackupRequest, Empty> deleteBackupSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).deleteBackupSettings();
}

/** Returns the object with the settings used for calls to listBackups. */
public PagedCallSettings<ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>
listBackupsSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).listBackupsSettings();
}

/** Returns the object with the settings used for calls to restoreDatabase. */
public UnaryCallSettings<RestoreDatabaseRequest, Operation> restoreDatabaseSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).restoreDatabaseSettings();
}

/** Returns the object with the settings used for calls to restoreDatabase. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<RestoreDatabaseRequest, Database, RestoreDatabaseMetadata>
restoreDatabaseOperationSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).restoreDatabaseOperationSettings();
}

/** Returns the object with the settings used for calls to listDatabaseOperations. */
public PagedCallSettings<
ListDatabaseOperationsRequest,
ListDatabaseOperationsResponse,
ListDatabaseOperationsPagedResponse>
listDatabaseOperationsSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).listDatabaseOperationsSettings();
}

/** Returns the object with the settings used for calls to listBackupOperations. */
public PagedCallSettings<
ListBackupOperationsRequest,
ListBackupOperationsResponse,
ListBackupOperationsPagedResponse>
listBackupOperationsSettings() {
return ((DatabaseAdminStubSettings) getStubSettings()).listBackupOperationsSettings();
}

/** Returns the object with the settings used for calls to listDatabases. */
public PagedCallSettings<ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
listDatabasesSettings() {
@@ -305,6 +387,72 @@ public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettin
return getStubSettingsBuilder().testIamPermissionsSettings();
}

/** Returns the builder for the settings used for calls to createBackup. */
public UnaryCallSettings.Builder<CreateBackupRequest, Operation> createBackupSettings() {
return getStubSettingsBuilder().createBackupSettings();
}

/** Returns the builder for the settings used for calls to createBackup. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<CreateBackupRequest, Backup, CreateBackupMetadata>
createBackupOperationSettings() {
return getStubSettingsBuilder().createBackupOperationSettings();
}

/** Returns the builder for the settings used for calls to getBackup. */
public UnaryCallSettings.Builder<GetBackupRequest, Backup> getBackupSettings() {
return getStubSettingsBuilder().getBackupSettings();
}

/** Returns the builder for the settings used for calls to updateBackup. */
public UnaryCallSettings.Builder<UpdateBackupRequest, Backup> updateBackupSettings() {
return getStubSettingsBuilder().updateBackupSettings();
}

/** Returns the builder for the settings used for calls to deleteBackup. */
public UnaryCallSettings.Builder<DeleteBackupRequest, Empty> deleteBackupSettings() {
return getStubSettingsBuilder().deleteBackupSettings();
}

/** Returns the builder for the settings used for calls to listBackups. */
public PagedCallSettings.Builder<
ListBackupsRequest, ListBackupsResponse, ListBackupsPagedResponse>
listBackupsSettings() {
return getStubSettingsBuilder().listBackupsSettings();
}

/** Returns the builder for the settings used for calls to restoreDatabase. */
public UnaryCallSettings.Builder<RestoreDatabaseRequest, Operation> restoreDatabaseSettings() {
return getStubSettingsBuilder().restoreDatabaseSettings();
}

/** Returns the builder for the settings used for calls to restoreDatabase. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<RestoreDatabaseRequest, Database, RestoreDatabaseMetadata>
restoreDatabaseOperationSettings() {
return getStubSettingsBuilder().restoreDatabaseOperationSettings();
}

/** Returns the builder for the settings used for calls to listDatabaseOperations. */
public PagedCallSettings.Builder<
ListDatabaseOperationsRequest,
ListDatabaseOperationsResponse,
ListDatabaseOperationsPagedResponse>
listDatabaseOperationsSettings() {
return getStubSettingsBuilder().listDatabaseOperationsSettings();
}

/** Returns the builder for the settings used for calls to listBackupOperations. */
public PagedCallSettings.Builder<
ListBackupOperationsRequest,
ListBackupOperationsResponse,
ListBackupOperationsPagedResponse>
listBackupOperationsSettings() {
return getStubSettingsBuilder().listBackupOperationsSettings();
}

/** Returns the builder for the settings used for calls to listDatabases. */
public PagedCallSettings.Builder<
ListDatabasesRequest, ListDatabasesResponse, ListDatabasesPagedResponse>
@@ -24,7 +24,8 @@
* <p>Service Description: Cloud Spanner Database Admin API
*
* <p>The Cloud Spanner Database Admin API can be used to create, drop, and list databases. It also
* enables updating the schema of pre-existing databases.
* enables updating the schema of pre-existing databases. It can be also used to create, delete and
* list backups for a database and to restore from an existing backup.
*
* <p>Sample for DatabaseAdminClient:
*
@@ -15,6 +15,9 @@
*/
package com.google.cloud.spanner.admin.database.v1.stub;

import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupOperationsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListBackupsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabaseOperationsPagedResponse;
import static com.google.cloud.spanner.admin.database.v1.DatabaseAdminClient.ListDatabasesPagedResponse;

import com.google.api.core.BetaApi;
@@ -29,15 +32,29 @@
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import com.google.spanner.admin.database.v1.Backup;
import com.google.spanner.admin.database.v1.CreateBackupMetadata;
import com.google.spanner.admin.database.v1.CreateBackupRequest;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import com.google.spanner.admin.database.v1.CreateDatabaseRequest;
import com.google.spanner.admin.database.v1.Database;
import com.google.spanner.admin.database.v1.DeleteBackupRequest;
import com.google.spanner.admin.database.v1.DropDatabaseRequest;
import com.google.spanner.admin.database.v1.GetBackupRequest;
import com.google.spanner.admin.database.v1.GetDatabaseDdlRequest;
import com.google.spanner.admin.database.v1.GetDatabaseDdlResponse;
import com.google.spanner.admin.database.v1.GetDatabaseRequest;
import com.google.spanner.admin.database.v1.ListBackupOperationsRequest;
import com.google.spanner.admin.database.v1.ListBackupOperationsResponse;
import com.google.spanner.admin.database.v1.ListBackupsRequest;
import com.google.spanner.admin.database.v1.ListBackupsResponse;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsRequest;
import com.google.spanner.admin.database.v1.ListDatabaseOperationsResponse;
import com.google.spanner.admin.database.v1.ListDatabasesRequest;
import com.google.spanner.admin.database.v1.ListDatabasesResponse;
import com.google.spanner.admin.database.v1.RestoreDatabaseMetadata;
import com.google.spanner.admin.database.v1.RestoreDatabaseRequest;
import com.google.spanner.admin.database.v1.UpdateBackupRequest;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest;
import javax.annotation.Generated;
@@ -103,6 +120,67 @@ public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()");
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<CreateBackupRequest, Backup, CreateBackupMetadata>
createBackupOperationCallable() {
throw new UnsupportedOperationException("Not implemented: createBackupOperationCallable()");
}

public UnaryCallable<CreateBackupRequest, Operation> createBackupCallable() {
throw new UnsupportedOperationException("Not implemented: createBackupCallable()");
}

public UnaryCallable<GetBackupRequest, Backup> getBackupCallable() {
throw new UnsupportedOperationException("Not implemented: getBackupCallable()");
}

public UnaryCallable<UpdateBackupRequest, Backup> updateBackupCallable() {
throw new UnsupportedOperationException("Not implemented: updateBackupCallable()");
}

public UnaryCallable<DeleteBackupRequest, Empty> deleteBackupCallable() {
throw new UnsupportedOperationException("Not implemented: deleteBackupCallable()");
}

public UnaryCallable<ListBackupsRequest, ListBackupsPagedResponse> listBackupsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listBackupsPagedCallable()");
}

public UnaryCallable<ListBackupsRequest, ListBackupsResponse> listBackupsCallable() {
throw new UnsupportedOperationException("Not implemented: listBackupsCallable()");
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<RestoreDatabaseRequest, Database, RestoreDatabaseMetadata>
restoreDatabaseOperationCallable() {
throw new UnsupportedOperationException("Not implemented: restoreDatabaseOperationCallable()");
}

public UnaryCallable<RestoreDatabaseRequest, Operation> restoreDatabaseCallable() {
throw new UnsupportedOperationException("Not implemented: restoreDatabaseCallable()");
}

public UnaryCallable<ListDatabaseOperationsRequest, ListDatabaseOperationsPagedResponse>
listDatabaseOperationsPagedCallable() {
throw new UnsupportedOperationException(
"Not implemented: listDatabaseOperationsPagedCallable()");
}

public UnaryCallable<ListDatabaseOperationsRequest, ListDatabaseOperationsResponse>
listDatabaseOperationsCallable() {
throw new UnsupportedOperationException("Not implemented: listDatabaseOperationsCallable()");
}

public UnaryCallable<ListBackupOperationsRequest, ListBackupOperationsPagedResponse>
listBackupOperationsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listBackupOperationsPagedCallable()");
}

public UnaryCallable<ListBackupOperationsRequest, ListBackupOperationsResponse>
listBackupOperationsCallable() {
throw new UnsupportedOperationException("Not implemented: listBackupOperationsCallable()");
}

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

0 comments on commit 5643c22

Please sign in to comment.