Class ProjectsResource.InstancesResource.DatabasesResource
The "databases" collection of methods.
Inherited Members
Namespace: Google.Apis.Spanner.v1
Assembly: Google.Apis.Spanner.v1.dll
Syntax
public class ProjectsResource.InstancesResource.DatabasesResource
Constructors
DatabasesResource(IClientService)
Constructs a new resource.
Declaration
public DatabasesResource(IClientService service)
Parameters
Type | Name | Description |
---|---|---|
IClientService | service |
Properties
BackupSchedules
Gets the BackupSchedules resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.BackupSchedulesResource BackupSchedules { get; }
Property Value
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.BackupSchedulesResource |
DatabaseRoles
Gets the DatabaseRoles resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.DatabaseRolesResource DatabaseRoles { get; }
Property Value
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.DatabaseRolesResource |
Operations
Gets the Operations resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.OperationsResource Operations { get; }
Property Value
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.OperationsResource |
Sessions
Gets the Sessions resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.SessionsResource Sessions { get; }
Property Value
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.SessionsResource |
Methods
Changequorum(ChangeQuorumRequest, string)
ChangeQuorum
is strictly restricted to databases that use dual-region instance configurations.
Initiates a background operation to change the quorum of a database from dual-region mode to
single-region mode or vice versa. The returned long-running operation has a name of the format
projects//instances//databases//operations/
and can be used to track execution of the
ChangeQuorum
. The metadata field type is ChangeQuorumMetadata. Authorization requires
spanner.databases.changequorum
permission on the resource database.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.ChangequorumRequest Changequorum(ChangeQuorumRequest body, string name)
Parameters
Type | Name | Description |
---|---|---|
ChangeQuorumRequest | body | The body of the request. |
string | name | Required. Name of the database in which to apply |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.ChangequorumRequest |
Create(CreateDatabaseRequest, string)
Creates a new Spanner database and starts to prepare it for serving. The returned long-running
operation will have a name of the format /operations/
and can be used to track preparation of the
database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if
successful.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.CreateRequest Create(CreateDatabaseRequest body, string parent)
Parameters
Type | Name | Description |
---|---|---|
CreateDatabaseRequest | body | The body of the request. |
string | parent | Required. The name of the instance that will serve the new database. Values are of the form
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.CreateRequest |
DropDatabase(string)
Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained
according to their expire_time
. Note: Cloud Spanner might continue to accept requests for a few
seconds after the database has been deleted.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.DropDatabaseRequest DropDatabase(string database)
Parameters
Type | Name | Description |
---|---|---|
string | database | Required. The database to be dropped. |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.DropDatabaseRequest |
Get(string)
Gets the state of a Cloud Spanner database.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.GetRequest Get(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the requested database. Values are of the form
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.GetRequest |
GetDdl(string)
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 API.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.GetDdlRequest GetDdl(string database)
Parameters
Type | Name | Description |
---|---|---|
string | database | Required. The database whose schema we wish to get. Values are of the form
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.GetDdlRequest |
GetIamPolicy(GetIamPolicyRequest, string)
Gets the access control policy for a database or backup resource. Returns an empty policy if a
database or backup exists but does not have a policy set. Authorization requires
spanner.databases.getIamPolicy
permission on resource. For backups, authorization requires
spanner.backups.getIamPolicy
permission on resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.GetIamPolicyRequest GetIamPolicy(GetIamPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
GetIamPolicyRequest | body | The body of the request. |
string | resource | REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.GetIamPolicyRequest |
GetScans(string)
Request a specific scan with Database-specific data for Cloud Key Visualizer.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.GetScansRequest GetScans(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The unique name of the scan containing the requested information, specific to the Database service implementing this interface. |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.GetScansRequest |
List(string)
Lists Cloud Spanner databases.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.ListRequest List(string parent)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The instance whose databases should be listed. Values are of the form
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.ListRequest |
Patch(Database, string)
Updates a Cloud Spanner database. The returned long-running operation can be used to track the
progress of updating the database. If the named database does not exist, returns NOT_FOUND
. While
the operation is pending: * The database's reconciling field is set to true. * Cancelling the
operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set,
the updates are reverted, and the operation terminates with a CANCELLED
status. * New
UpdateDatabase requests will return a FAILED_PRECONDITION
error until the pending operation is
done (returns successfully or with error). * Reading the database via the API continues to give the
pre-request values. Upon completion of the returned operation: * The new values are in effect and
readable via the API. * The database's reconciling field becomes false. The returned long-running
operation will have a name of the format projects//instances//databases//operations/
and can be
used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The
response field type is Database, if successful.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.PatchRequest Patch(Database body, string name)
Parameters
Type | Name | Description |
---|---|---|
Database | body | The body of the request. |
string | name | Required. The name of the database. Values are of the form |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.PatchRequest |
Restore(RestoreDatabaseRequest, string)
Create a new database by restoring from a completed backup. The new database must be in the same
project and in an instance with the same instance configuration as the instance containing the
backup. The returned database long-running operation has a name of the format
projects//instances//databases//operations/
, and can be used to track the progress of the
operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type
is Database, if successful. Cancelling the returned operation will stop the restore and delete the
database. There can be only one database being restored into an instance at a time. Once the restore
operation completes, a new restore operation can be initiated, without waiting for the optimize
operation associated with the first restore to complete.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.RestoreRequest Restore(RestoreDatabaseRequest body, string parent)
Parameters
Type | Name | Description |
---|---|---|
RestoreDatabaseRequest | body | The body of the request. |
string | parent | Required. The name of the instance in which to create the restored database. This instance must be
in the same project and have the same instance configuration as the instance containing the source
backup. Values are of the form |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.RestoreRequest |
SetIamPolicy(SetIamPolicyRequest, string)
Sets the access control policy on a database or backup resource. Replaces any existing policy.
Authorization requires spanner.databases.setIamPolicy
permission on resource. For backups,
authorization requires spanner.backups.setIamPolicy
permission on resource.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.SetIamPolicyRequest SetIamPolicy(SetIamPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
SetIamPolicyRequest | body | The body of the request. |
string | resource | REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.SetIamPolicyRequest |
TestIamPermissions(TestIamPermissionsRequest, string)
Returns permissions that the caller has on the specified database or backup 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. Calling this method on a backup that does not exist will result in a
NOT_FOUND error if the user has spanner.backups.list
permission on the containing instance.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.TestIamPermissionsRequest TestIamPermissions(TestIamPermissionsRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
TestIamPermissionsRequest | body | The body of the request. |
string | resource | REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is
|
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.TestIamPermissionsRequest |
UpdateDdl(UpdateDatabaseDdlRequest, string)
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns,
indexes, etc. The returned long-running operation will have a name of the format /operations/
and
can be used to track execution of the schema change(s). The metadata field type is
UpdateDatabaseDdlMetadata. The operation has no response.
Declaration
public virtual ProjectsResource.InstancesResource.DatabasesResource.UpdateDdlRequest UpdateDdl(UpdateDatabaseDdlRequest body, string database)
Parameters
Type | Name | Description |
---|---|---|
UpdateDatabaseDdlRequest | body | The body of the request. |
string | database | Required. The database to update. |
Returns
Type | Description |
---|---|
ProjectsResource.InstancesResource.DatabasesResource.UpdateDdlRequest |