public static final class DatabaseAdminGrpc.DatabaseAdminStub extends io.grpc.stub.AbstractStub<DatabaseAdminGrpc.DatabaseAdminStub>
Cloud Spanner Database Admin API 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.
Modifier and Type | Method and Description |
---|---|
protected DatabaseAdminGrpc.DatabaseAdminStub |
build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) |
void |
createDatabase(CreateDatabaseRequest request,
io.grpc.stub.StreamObserver<Operation> responseObserver)
Creates a new Cloud Spanner database and starts to prepare it for serving.
|
void |
dropDatabase(DropDatabaseRequest request,
io.grpc.stub.StreamObserver<Empty> responseObserver)
Drops (aka deletes) a Cloud Spanner database.
|
void |
getDatabase(GetDatabaseRequest request,
io.grpc.stub.StreamObserver<Database> responseObserver)
Gets the state of a Cloud Spanner database.
|
void |
getDatabaseDdl(GetDatabaseDdlRequest request,
io.grpc.stub.StreamObserver<GetDatabaseDdlResponse> responseObserver)
Returns the schema of a Cloud Spanner database as a list of formatted
DDL statements.
|
void |
getIamPolicy(GetIamPolicyRequest request,
io.grpc.stub.StreamObserver<Policy> responseObserver)
Gets the access control policy for a database resource.
|
void |
listDatabases(ListDatabasesRequest request,
io.grpc.stub.StreamObserver<ListDatabasesResponse> responseObserver)
Lists Cloud Spanner databases.
|
void |
setIamPolicy(SetIamPolicyRequest request,
io.grpc.stub.StreamObserver<Policy> responseObserver)
Sets the access control policy on a database resource.
|
void |
testIamPermissions(TestIamPermissionsRequest request,
io.grpc.stub.StreamObserver<TestIamPermissionsResponse> responseObserver)
Returns permissions that the caller has on the specified database resource.
|
void |
updateDatabaseDdl(UpdateDatabaseDdlRequest request,
io.grpc.stub.StreamObserver<Operation> responseObserver)
Updates the schema of a Cloud Spanner database by
creating/altering/dropping tables, columns, indexes, etc.
|
protected DatabaseAdminGrpc.DatabaseAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
build
in class io.grpc.stub.AbstractStub<DatabaseAdminGrpc.DatabaseAdminStub>
public void listDatabases(ListDatabasesRequest request, io.grpc.stub.StreamObserver<ListDatabasesResponse> responseObserver)
Lists Cloud Spanner databases.
public void createDatabase(CreateDatabaseRequest request, io.grpc.stub.StreamObserver<Operation> responseObserver)
Creates a new Cloud Spanner database and starts to prepare it for serving. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track preparation of the database. The [metadata][google.longrunning.Operation.metadata] field type is [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The [response][google.longrunning.Operation.response] field type is [Database][google.spanner.admin.database.v1.Database], if successful.
public void getDatabase(GetDatabaseRequest request, io.grpc.stub.StreamObserver<Database> responseObserver)
Gets the state of a Cloud Spanner database.
public void updateDatabaseDdl(UpdateDatabaseDdlRequest request, io.grpc.stub.StreamObserver<Operation> responseObserver)
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned [long-running operation][google.longrunning.Operation] will have a name of the format `<database_name>/operations/<operation_id>` and can be used to track execution of the schema change(s). The [metadata][google.longrunning.Operation.metadata] field type is [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
public void dropDatabase(DropDatabaseRequest request, io.grpc.stub.StreamObserver<Empty> responseObserver)
Drops (aka deletes) a Cloud Spanner database.
public void getDatabaseDdl(GetDatabaseDdlRequest request, io.grpc.stub.StreamObserver<GetDatabaseDdlResponse> responseObserver)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
public void setIamPolicy(SetIamPolicyRequest request, io.grpc.stub.StreamObserver<Policy> responseObserver)
Sets the access control policy on a database resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
public void getIamPolicy(GetIamPolicyRequest request, io.grpc.stub.StreamObserver<Policy> responseObserver)
Gets the access control policy for a database resource. Returns an empty policy if a database exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
public void testIamPermissions(TestIamPermissionsRequest request, io.grpc.stub.StreamObserver<TestIamPermissionsResponse> responseObserver)
Returns permissions that the caller has on the specified database resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions.