Cloud Spanner Database Admin API
The Cloud Spanner Database Admin API can be used to: * create, drop, and list databases * update the schema of pre-existing databases * create, delete and list backups for a database * restore a database from an existing backup v1
Package
@google-cloud/spannerConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of DatabaseAdminClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
databaseAdminStub
databaseAdminStub?: Promise<{
[name: string]: Function;
}>;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
operationsClient
operationsClient: gax.OperationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
backupPath(project, instance, backup)
backupPath(project: string, instance: string, backup: string): string;
Return a fully-qualified backup resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
backup |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkCopyBackupProgress(name)
checkCopyBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CopyBackupMetadata>>;
Check the status of the long running operation returned by copyBackup()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CopyBackupMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
checkCreateBackupProgress(name)
checkCreateBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CreateBackupMetadata>>;
Check the status of the long running operation returned by createBackup()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CreateBackupMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
checkCreateDatabaseProgress(name)
checkCreateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>>;
Check the status of the long running operation returned by createDatabase()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
checkRestoreDatabaseProgress(name)
checkRestoreDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata>>;
Check the status of the long running operation returned by restoreDatabase()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
checkUpdateDatabaseDdlProgress(name)
checkUpdateDatabaseDdlProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>>;
Check the status of the long running operation returned by updateDatabaseDdl()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
checkUpdateDatabaseProgress(name)
checkUpdateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata>>;
Check the status of the long running operation returned by updateDatabase()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples. |
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
copyBackup(request, options)
copyBackup(request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, options?: CallOptions): Promise<[
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Starts copying a Cloud Spanner Backup. The returned backup will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated with the destination backup. The field type is . The field type is , if successful. Cancelling the returned operation will stop the copying and delete the backup. Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
request |
ICopyBackupRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
copyBackup(request, options, callback)
copyBackup(request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICopyBackupRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
copyBackup(request, callback)
copyBackup(request: protos.google.spanner.admin.database.v1.ICopyBackupRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICopyBackupRequest
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createBackup(request, options)
createBackup(request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options?: CallOptions): Promise<[
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Starts creating a new Cloud Spanner Backup. The returned backup will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The field type is . The field type is , if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
request |
ICreateBackupRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
createBackup(request, options, callback)
createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateBackupRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createBackup(request, callback)
createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateBackupRequest
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createDatabase(request, options)
createDatabase(request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options?: CallOptions): Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates a new Cloud Spanner database and starts to prepare it for serving. The returned will have a name of the format <database_name>/operations/<operation_id>
and can be used to track preparation of the database. The field type is . The field type is , if successful.
Parameters | |
---|---|
Name | Description |
request |
ICreateDatabaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
createDatabase(request, options, callback)
createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateDatabaseRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createDatabase(request, callback)
createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateDatabaseRequest
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
cryptoKeyPath(project, location, keyRing, cryptoKey)
cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;
Return a fully-qualified cryptoKey resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
keyRing |
string
|
cryptoKey |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
databasePath(project, instance, database)
databasePath(project: string, instance: string, database: string): string;
Return a fully-qualified database resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
database |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
databaseRolePath(project, instance, database, role)
databaseRolePath(project: string, instance: string, database: string, role: string): string;
Return a fully-qualified databaseRole resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
database |
string
|
role |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
deleteBackup(request, options)
deleteBackup(request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.spanner.admin.database.v1.IDeleteBackupRequest | undefined,
{} | undefined
]>;
Deletes a pending or completed .
Parameters | |
---|---|
Name | Description |
request |
IDeleteBackupRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.google.spanner.admin.database.v1.IDeleteBackupRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
deleteBackup(request, options, callback)
deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteBackupRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteBackup(request, callback)
deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteBackupRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
dropDatabase(request, options)
dropDatabase(request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.spanner.admin.database.v1.IDropDatabaseRequest | undefined,
{} | undefined
]>;
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.
Parameters | |
---|---|
Name | Description |
request |
IDropDatabaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.google.spanner.admin.database.v1.IDropDatabaseRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
dropDatabase(request, options, callback)
dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDropDatabaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
dropDatabase(request, callback)
dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDropDatabaseRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getBackup(request, options)
getBackup(request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackup,
protos.google.spanner.admin.database.v1.IGetBackupRequest | undefined,
{} | undefined
]>;
Gets metadata on a pending or completed .
Parameters | |
---|---|
Name | Description |
request |
IGetBackupRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IBackup,
protos.google.spanner.admin.database.v1.IGetBackupRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
getBackup(request, options, callback)
getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetBackupRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getBackup(request, callback)
getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetBackupRequest
|
callback |
Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDatabase(request, options)
getDatabase(request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IDatabase,
protos.google.spanner.admin.database.v1.IGetDatabaseRequest | undefined,
{} | undefined
]>;
Gets the state of a Cloud Spanner database.
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IDatabase,
protos.google.spanner.admin.database.v1.IGetDatabaseRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
getDatabase(request, options, callback)
getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDatabase(request, callback)
getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, callback: Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseRequest
|
callback |
Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDatabaseDdl(request, options)
getDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse,
(protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | undefined),
{} | undefined
]>;
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 API.
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseDdlRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse,
(protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
getDatabaseDdl(request, options, callback)
getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseDdlRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getDatabaseDdl(request, callback)
getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetDatabaseDdlRequest
|
callback |
Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;
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 . For backups, authorization requires spanner.backups.getIamPolicy
permission on .
Parameters | |
---|---|
Name | Description |
request |
IGetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
GetOperationRequest
The request object that will be sent. |
options |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<[protos.google.longrunning.Operation]> |
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
instancePath(project, instance)
instancePath(project: string, instance: string): string;
Return a fully-qualified instance resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
instance |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
listBackupOperations(request, options)
listBackupOperations(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): Promise<[
protos.google.longrunning.IOperation[],
protos.google.spanner.admin.database.v1.IListBackupOperationsRequest | null,
protos.google.spanner.admin.database.v1.IListBackupOperationsResponse
]>;
Lists the backup in the given instance. A backup operation has a name of the form projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>
. The long-running operation field type metadata.type_url
describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.progress.start_time
in descending order starting from the most recently started operation.
Parameters | |
---|---|
Name | Description |
request |
IListBackupOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.longrunning.IOperation[],
protos.google.spanner.admin.database.v1.IListBackupOperationsRequest | null,
protos.google.spanner.admin.database.v1.IListBackupOperationsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listBackupOperations(request, options, callback)
listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListBackupOperationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>
|
Returns | |
---|---|
Type | Description |
void |
listBackupOperations(request, callback)
listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListBackupOperationsRequest
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>
|
Returns | |
---|---|
Type | Description |
void |
listBackupOperationsAsync(request, options)
listBackupOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
Equivalent to listBackupOperations
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListBackupOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.IOperation> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listBackupOperationsStream(request, options)
listBackupOperationsStream(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListBackupOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listBackups(request, options)
listBackups(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackup[],
protos.google.spanner.admin.database.v1.IListBackupsRequest | null,
protos.google.spanner.admin.database.v1.IListBackupsResponse
]>;
Lists completed and pending backups. Backups returned are ordered by create_time
in descending order, starting from the most recent create_time
.
Parameters | |
---|---|
Name | Description |
request |
IListBackupsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IBackup[],
protos.google.spanner.admin.database.v1.IListBackupsRequest | null,
protos.google.spanner.admin.database.v1.IListBackupsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listBackups(request, options, callback)
listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>): void;
Parameters | |
---|---|
Name | Description |
request |
IListBackupsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>
|
Returns | |
---|---|
Type | Description |
void |
listBackups(request, callback)
listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>): void;
Parameters | |
---|---|
Name | Description |
request |
IListBackupsRequest
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>
|
Returns | |
---|---|
Type | Description |
void |
listBackupsAsync(request, options)
listBackupsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IBackup>;
Equivalent to listBackups
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListBackupsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.spanner.admin.database.v1.IBackup> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listBackupsStream(request, options)
listBackupsStream(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListBackupsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listDatabaseOperations(request, options)
listDatabaseOperations(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): Promise<[
protos.google.longrunning.IOperation[],
protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest | null,
protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse
]>;
Lists database . A database operation has a name of the form projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
. The long-running operation field type metadata.type_url
describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.longrunning.IOperation[],
protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest | null,
protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listDatabaseOperations(request, options, callback)
listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseOperationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>
|
Returns | |
---|---|
Type | Description |
void |
listDatabaseOperations(request, callback)
listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseOperationsRequest
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>
|
Returns | |
---|---|
Type | Description |
void |
listDatabaseOperationsAsync(request, options)
listDatabaseOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
Equivalent to listDatabaseOperations
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.IOperation> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listDatabaseOperationsStream(request, options)
listDatabaseOperationsStream(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseOperationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listDatabaseRoles(request, options)
listDatabaseRoles(request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IDatabaseRole[],
protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest | null,
protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse
]>;
Lists Cloud Spanner database roles.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseRolesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IDatabaseRole[],
protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest | null,
protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listDatabaseRoles(request, options, callback)
listDatabaseRoles(request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabaseRole>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseRolesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabaseRole>
|
Returns | |
---|---|
Type | Description |
void |
listDatabaseRoles(request, callback)
listDatabaseRoles(request: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabaseRole>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseRolesRequest
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, protos.google.spanner.admin.database.v1.IListDatabaseRolesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabaseRole>
|
Returns | |
---|---|
Type | Description |
void |
listDatabaseRolesAsync(request, options)
listDatabaseRolesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabaseRole>;
Equivalent to listDatabaseRoles
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseRolesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.spanner.admin.database.v1.IDatabaseRole> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listDatabaseRolesStream(request, options)
listDatabaseRolesStream(request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListDatabaseRolesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listDatabases(request, options)
listDatabases(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IDatabase[],
protos.google.spanner.admin.database.v1.IListDatabasesRequest | null,
protos.google.spanner.admin.database.v1.IListDatabasesResponse
]>;
Lists Cloud Spanner databases.
Parameters | |
---|---|
Name | Description |
request |
IListDatabasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IDatabase[],
protos.google.spanner.admin.database.v1.IListDatabasesRequest | null,
protos.google.spanner.admin.database.v1.IListDatabasesResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listDatabases(request, options, callback)
listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabasesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>
|
Returns | |
---|---|
Type | Description |
void |
listDatabases(request, callback)
listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>): void;
Parameters | |
---|---|
Name | Description |
request |
IListDatabasesRequest
|
callback |
PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>
|
Returns | |
---|---|
Type | Description |
void |
listDatabasesAsync(request, options)
listDatabasesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase>;
Equivalent to listDatabases
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListDatabasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
listDatabasesStream(request, options)
listDatabasesStream(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListDatabasesRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters | |
---|---|
Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.ListOperationsResponse> | {Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
matchBackupFromBackupName(backupName)
matchBackupFromBackupName(backupName: string): string | number;
Parse the backup from Backup resource.
Parameter | |
---|---|
Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the backup. |
matchCryptoKeyFromCryptoKeyName(cryptoKeyName)
matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the crypto_key from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the crypto_key. |
matchDatabaseFromDatabaseName(databaseName)
matchDatabaseFromDatabaseName(databaseName: string): string | number;
Parse the database from Database resource.
Parameter | |
---|---|
Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the database. |
matchDatabaseFromDatabaseRoleName(databaseRoleName)
matchDatabaseFromDatabaseRoleName(databaseRoleName: string): string | number;
Parse the database from DatabaseRole resource.
Parameter | |
---|---|
Name | Description |
databaseRoleName |
string
A fully-qualified path representing DatabaseRole resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the database. |
matchInstanceFromBackupName(backupName)
matchInstanceFromBackupName(backupName: string): string | number;
Parse the instance from Backup resource.
Parameter | |
---|---|
Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the instance. |
matchInstanceFromDatabaseName(databaseName)
matchInstanceFromDatabaseName(databaseName: string): string | number;
Parse the instance from Database resource.
Parameter | |
---|---|
Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the instance. |
matchInstanceFromDatabaseRoleName(databaseRoleName)
matchInstanceFromDatabaseRoleName(databaseRoleName: string): string | number;
Parse the instance from DatabaseRole resource.
Parameter | |
---|---|
Name | Description |
databaseRoleName |
string
A fully-qualified path representing DatabaseRole resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the instance. |
matchInstanceFromInstanceName(instanceName)
matchInstanceFromInstanceName(instanceName: string): string | number;
Parse the instance from Instance resource.
Parameter | |
---|---|
Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the instance. |
matchKeyRingFromCryptoKeyName(cryptoKeyName)
matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the key_ring from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the key_ring. |
matchLocationFromCryptoKeyName(cryptoKeyName)
matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the location from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchProjectFromBackupName(backupName)
matchProjectFromBackupName(backupName: string): string | number;
Parse the project from Backup resource.
Parameter | |
---|---|
Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromCryptoKeyName(cryptoKeyName)
matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the project from CryptoKey resource.
Parameter | |
---|---|
Name | Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromDatabaseName(databaseName)
matchProjectFromDatabaseName(databaseName: string): string | number;
Parse the project from Database resource.
Parameter | |
---|---|
Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromDatabaseRoleName(databaseRoleName)
matchProjectFromDatabaseRoleName(databaseRoleName: string): string | number;
Parse the project from DatabaseRole resource.
Parameter | |
---|---|
Name | Description |
databaseRoleName |
string
A fully-qualified path representing DatabaseRole resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromInstanceName(instanceName)
matchProjectFromInstanceName(instanceName: string): string | number;
Parse the project from Instance resource.
Parameter | |
---|---|
Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchRoleFromDatabaseRoleName(databaseRoleName)
matchRoleFromDatabaseRoleName(databaseRoleName: string): string | number;
Parse the role from DatabaseRole resource.
Parameter | |
---|---|
Name | Description |
databaseRoleName |
string
A fully-qualified path representing DatabaseRole resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the role. |
restoreDatabase(request, options)
restoreDatabase(request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options?: CallOptions): Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
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][google.longrunning.Operation] has a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>
, and can be used to track the progress of the operation, and to cancel it. The field type is . The type is , 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.
Parameters | |
---|---|
Name | Description |
request |
IRestoreDatabaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
restoreDatabase(request, options, callback)
restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IRestoreDatabaseRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
restoreDatabase(request, callback)
restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IRestoreDatabaseRequest
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;
Sets the access control policy on a database or backup resource. Replaces any existing policy.
Authorization requires spanner.databases.setIamPolicy
permission on . For backups, authorization requires spanner.backups.setIamPolicy
permission on .
Parameters | |
---|---|
Name | Description |
request |
ISetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ISetIamPolicyRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ISetIamPolicyRequest
|
callback |
Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;
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.
Parameters | |
---|---|
Name | Description |
request |
ITestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITestIamPermissionsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ITestIamPermissionsRequest
|
callback |
Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateBackup(request, options)
updateBackup(request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackup,
protos.google.spanner.admin.database.v1.IUpdateBackupRequest | undefined,
{} | undefined
]>;
Updates a pending or completed .
Parameters | |
---|---|
Name | Description |
request |
IUpdateBackupRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.spanner.admin.database.v1.IBackup,
protos.google.spanner.admin.database.v1.IUpdateBackupRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
updateBackup(request, options, callback)
updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateBackupRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateBackup(request, callback)
updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateBackupRequest
|
callback |
Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatabase(request, options)
updateDatabase(request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, options?: CallOptions): Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates a Cloud Spanner database. The returned 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 field is set to true. * Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's 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 field becomes false.
The returned will have a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>
and can be used to track the database modification. The field type is . The field type is , if successful.
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
updateDatabase(request, options, callback)
updateDatabase(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatabase(request, callback)
updateDatabase(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseRequest
|
callback |
Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatabaseDdl(request, options)
updateDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned 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 field type is . The operation has no response.
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseDdlRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
updateDatabaseDdl(request, options, callback)
updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseDdlRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateDatabaseDdl(request, callback)
updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateDatabaseDdlRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |