@google-cloud/spanner
Version:
Cloud Spanner Client Library for Node.js
733 lines (732 loc) • 151 kB
TypeScript
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
import { Transform } from 'stream';
import * as protos from '../../protos/protos';
/**
* 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, copy and list backups for a database
* * restore a database from an existing backup
* @class
* @memberof v1
*/
export declare class DatabaseAdminClient {
private _terminated;
private _opts;
private _providedCustomServicePath;
private _gaxModule;
private _gaxGrpc;
private _protos;
private _defaults;
private _universeDomain;
private _servicePath;
private _log;
auth: gax.GoogleAuth;
descriptors: Descriptors;
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {
[name: string]: Function;
};
pathTemplates: {
[name: string]: gax.PathTemplate;
};
operationsClient: gax.OperationsClient;
databaseAdminStub?: Promise<{
[name: string]: Function;
}>;
/**
* Construct an instance of DatabaseAdminClient.
*
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.
* @param {string} [options.credentials.client_email]
* @param {string} [options.credentials.private_key]
* @param {string} [options.email] - Account email address. Required when
* using a .pem or .p12 keyFilename.
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
* .p12 key downloaded from the Google Developers Console. If you provide
* a path to a JSON file, the projectId option below is not necessary.
* NOTE: .pem and .p12 require you to specify options.email as well.
* @param {number} [options.port] - The port on which to connect to
* the remote host.
* @param {string} [options.projectId] - The project ID from the Google
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
* the environment variable GCLOUD_PROJECT for your project ID. If your
* app is running in an environment which supports
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
* your project ID will be detected automatically.
* @param {string} [options.apiEndpoint] - The domain name of the
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new DatabaseAdminClient({fallback: true}, gax);
* ```
*/
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**
* 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 {Promise} A promise that resolves to an authenticated service stub.
*/
initialize(): Promise<{
[name: string]: Function;
}>;
/**
* The DNS address for this API service.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get servicePath(): string;
/**
* The DNS address for this API service - same as servicePath.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get apiEndpoint(): string;
/**
* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/
get apiEndpoint(): string;
get universeDomain(): string;
/**
* The port for this API service.
* @returns {number} The default port for this service.
*/
static get port(): number;
/**
* The scopes needed to make gRPC calls for every method defined
* in this service.
* @returns {string[]} List of default scopes.
*/
static get scopes(): string[];
getProjectId(): Promise<string>;
getProjectId(callback: Callback<string, undefined, undefined>): void;
/**
* Gets the state of a Cloud Spanner database.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the requested database. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Database|Database}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* 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.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.database
* Required. The database to be dropped.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* 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 {@link protos.google.longrunning.Operations|Operations} API.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.database
* Required. The database whose schema we wish to get.
* Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.GetDatabaseDdlResponse|GetDatabaseDdlResponse}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Sets the access control policy on a database or backup resource.
* Replaces any existing policy.
*
* Authorization requires `spanner.databases.setIamPolicy`
* permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}.
* For backups, authorization requires `spanner.backups.setIamPolicy`
* permission on {@link protos.google.iam.v1.SetIamPolicyRequest.resource|resource}.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.resource
* REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
* @param {google.iam.v1.Policy} request.policy
* REQUIRED: The complete policy to be applied to the `resource`. The size of
* the policy is limited to a few 10s of KB. An empty policy is a
* valid policy but certain Cloud Platform services (such as Projects)
* might reject them.
* @param {google.protobuf.FieldMask} request.updateMask
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used:
*
* `paths: "bindings, etag"`
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;
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;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
/**
* 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
* {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}.
* For backups, authorization requires `spanner.backups.getIamPolicy`
* permission on {@link protos.google.iam.v1.GetIamPolicyRequest.resource|resource}.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.resource
* REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
* @param {google.iam.v1.GetPolicyOptions} request.options
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;
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;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
/**
* 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.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.resource
* REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param {string[]} request.permissions
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;
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;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
/**
* Gets metadata on a pending or completed
* {@link protos.google.spanner.admin.database.v1.Backup|Backup}.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. Name of the backup.
* Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Updates a pending or completed
* {@link protos.google.spanner.admin.database.v1.Backup|Backup}.
*
* @param {Object} request
* The request object that will be sent.
* @param {google.spanner.admin.database.v1.Backup} request.backup
* Required. The backup to update. `backup.name`, and the fields to be updated
* as specified by `update_mask` are required. Other fields are ignored.
* Update is only supported for the following fields:
* * `backup.expire_time`.
* @param {google.protobuf.FieldMask} request.updateMask
* Required. A mask specifying which fields (e.g. `expire_time`) in the
* Backup resource should be updated. This mask is relative to the Backup
* resource, not to the request message. The field mask must always be
* specified; this prevents any future fields from being erased accidentally
* by clients that do not know about them.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.Backup|Backup}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Deletes a pending or completed
* {@link protos.google.spanner.admin.database.v1.Backup|Backup}.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. Name of the backup to delete.
* Values are of the form
* `projects/<project>/instances/<instance>/backups/<backup>`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Adds split points to specified tables, indexes of a database.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.database
* Required. The database on whose tables/indexes split points are to be
* added. Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>`.
* @param {number[]} request.splitPoints
* Required. The split points to add.
* @param {string} [request.initiator]
* Optional. A user-supplied tag associated with the split points.
* For example, "intital_data_load", "special_event_1".
* Defaults to "CloudAddSplitPointsAPI" if not specified.
* The length of the tag must not exceed 50 characters,else will be trimmed.
* Only valid UTF8 characters are allowed.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.AddSplitPointsResponse|AddSplitPointsResponse}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
addSplitPoints(request?: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IAddSplitPointsResponse,
(protos.google.spanner.admin.database.v1.IAddSplitPointsRequest | undefined),
{} | undefined
]>;
addSplitPoints(request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, protos.google.spanner.admin.database.v1.IAddSplitPointsRequest | null | undefined, {} | null | undefined>): void;
addSplitPoints(request: protos.google.spanner.admin.database.v1.IAddSplitPointsRequest, callback: Callback<protos.google.spanner.admin.database.v1.IAddSplitPointsResponse, protos.google.spanner.admin.database.v1.IAddSplitPointsRequest | null | undefined, {} | null | undefined>): void;
/**
* Creates a new backup schedule.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The name of the database that this backup schedule applies to.
* @param {string} request.backupScheduleId
* Required. The Id to use for the backup schedule. The `backup_schedule_id`
* appended to `parent` forms the full backup schedule name of the form
* `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
* @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule
* Required. The backup schedule to create.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
createBackupSchedule(request?: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackupSchedule,
(protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest | undefined),
{} | undefined
]>;
createBackupSchedule(request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
createBackupSchedule(request: protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.ICreateBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
/**
* Gets backup schedule for the input schedule name.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the schedule to retrieve.
* Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
getBackupSchedule(request?: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackupSchedule,
(protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest | undefined),
{} | undefined
]>;
getBackupSchedule(request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
getBackupSchedule(request: protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.IGetBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
/**
* Updates a backup schedule.
*
* @param {Object} request
* The request object that will be sent.
* @param {google.spanner.admin.database.v1.BackupSchedule} request.backupSchedule
* Required. The backup schedule to update. `backup_schedule.name`, and the
* fields to be updated as specified by `update_mask` are required. Other
* fields are ignored.
* @param {google.protobuf.FieldMask} request.updateMask
* Required. A mask specifying which fields in the BackupSchedule resource
* should be updated. This mask is relative to the BackupSchedule resource,
* not to the request message. The field mask must always be
* specified; this prevents any future fields from being erased
* accidentally.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
updateBackupSchedule(request?: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, options?: CallOptions): Promise<[
protos.google.spanner.admin.database.v1.IBackupSchedule,
(protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest | undefined),
{} | undefined
]>;
updateBackupSchedule(request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
updateBackupSchedule(request: protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackupSchedule, protos.google.spanner.admin.database.v1.IUpdateBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
/**
* Deletes a backup schedule.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the schedule to delete.
* Values are of the form
* `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
* for more details and examples.
*/
deleteBackupSchedule(request?: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest | undefined),
{} | undefined
]>;
deleteBackupSchedule(request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
deleteBackupSchedule(request: protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupScheduleRequest | null | undefined, {} | null | undefined>): void;
/**
* Creates a new Cloud Spanner database and starts to prepare it for serving.
* The returned {@link protos.google.longrunning.Operation|long-running operation} will
* have a name of the format `<database_name>/operations/<operation_id>` and
* can be used to track preparation of the database. The
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
* {@link protos.google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}.
* The {@link protos.google.longrunning.Operation.response|response} field type is
* {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* Required. The name of the instance that will serve the new database.
* Values are of the form `projects/<project>/instances/<instance>`.
* @param {string} request.createStatement
* Required. A `CREATE DATABASE` statement, which specifies the ID of the
* new database. The database ID must conform to the regular expression
* `{@link protos.a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length.
* If the database ID is a reserved word or if it contains a hyphen, the
* database ID must be enclosed in backticks (`` ` ``).
* @param {string[]} [request.extraStatements]
* Optional. A list of DDL statements to run inside the newly created
* database. Statements can create tables, indexes, etc. These
* statements execute atomically with the creation of the database:
* if there is an error in any statement, the database is not created.
* @param {google.spanner.admin.database.v1.EncryptionConfig} [request.encryptionConfig]
* Optional. The encryption configuration for the database. If this field is
* not specified, Cloud Spanner will encrypt/decrypt all data at rest using
* Google default encryption.
* @param {google.spanner.admin.database.v1.DatabaseDialect} [request.databaseDialect]
* Optional. The dialect of the Cloud Spanner Database.
* @param {Buffer} [request.protoDescriptors]
* Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
* 'extra_statements' above.
* Contains a protobuf-serialized
* [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
* To generate it, [install](https://grpc.io/docs/protoc-installation/) and
* run `protoc` with --include_imports and --descriptor_set_out. For example,
* to generate for moon/shot/app.proto, run
* ```
* $protoc --proto_path=/app_path --proto_path=/lib_path \
* --include_imports \
* --descriptor_set_out=descriptors.data \
* moon/shot/app.proto
* ```
* For more details, see protobuffer [self
* description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Check the status of the long running operation returned by `createDatabase()`.
* @param {String} name
* The operation name that will be passed.
* @returns {Promise} - The promise which resolves to an object.
* The decoded operation object has result and metadata field to get information from.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
* for more details and examples.
*/
checkCreateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>>;
/**
* Updates a Cloud Spanner database. The returned
* {@link protos.google.longrunning.Operation|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
* {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling}
* field is set to true.
* * Cancelling the operation is best-effort. If the cancellation succeeds,
* the operation metadata's
* {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|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
* {@link protos.google.spanner.admin.database.v1.Database.reconciling|reconciling}
* field becomes false.
*
* The returned {@link protos.google.longrunning.Operation|long-running operation} 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
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
* {@link protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}.
* The {@link protos.google.longrunning.Operation.response|response} field type is
* {@link protos.google.spanner.admin.database.v1.Database|Database}, if successful.
*
* @param {Object} request
* The request object that will be sent.
* @param {google.spanner.admin.database.v1.Database} request.database
* Required. The database to update.
* The `name` field of the database is of the form
* `projects/<project>/instances/<instance>/databases/<database>`.
* @param {google.protobuf.FieldMask} request.updateMask
* Required. The list of fields to update. Currently, only
* `enable_drop_protection` field can be updated.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**
* Check the status of the long running operation returned by `updateDatabase()`.
* @param {String} name
* The operation name that will be passed.
* @returns {Promise} - The promise which resolves to an object.
* The decoded operation object has result and metadata field to get information from.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
* for more details and examples.
*/
checkUpdateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata>>;
/**
* Updates the schema of a Cloud Spanner database by
* creating/altering/dropping tables, columns, indexes, etc. The returned
* {@link protos.google.longrunning.Operation|long-running operation} will have a name of
* the format `<database_name>/operations/<operation_id>` and can be used to
* track execution of the schema change(s). The
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
* {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}.
* The operation has no response.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.database
* Required. The database to update.
* @param {string[]} request.statements
* Required. DDL statements to be applied to the database.
* @param {string} request.operationId
* If empty, the new update request is assigned an
* automatically-generated operation ID. Otherwise, `operation_id`
* is used to construct the name of the resulting
* {@link protos.google.longrunning.Operation|Operation}.
*
* Specifying an explicit operation ID simplifies determining
* whether the statements were executed in the event that the
* {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl}
* call is replayed, or the return value is otherwise lost: the
* {@link protos.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database}
* and `operation_id` fields can be combined to form the
* {@link protos.google.longrunning.Operation.name|name} of the resulting
* {@link protos.google.longrunning.Operation|longrunning.Operation}:
* `<database>/operations/<operation_id>`.
*
* `operation_id` should be unique within the database, and must be
* a valid identifier: `{@link protos.a-z0-9_|a-z}*`. Note that
* automatically-generated operation IDs always begin with an
* underscore. If the named operation already exists,
* {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl}
* returns `ALREADY_EXISTS`.
* @param {Buffer} [request.protoDescriptors]
* Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
* Contains a protobuf-serialized
* [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
* To generate it, [install](https://grpc.io/docs/protoc-installation/) and
* run `protoc` with --include_imports and --descriptor_set_out. For example,
* to generate for moon/shot/app.proto, run
* ```
* $protoc --proto_path=/app_path --proto_path=/lib_path \
* --include_imports \
* --descriptor_set_out=descriptors.data \
* moon/shot/app.proto
* ```
* For more details, see protobuffer [self
* description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
* The first element of the array is an object representing
* a long running operation. Its `promise()` method returns a promise
* you can `await` for.
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
* for more details and examples.
*/
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
]>;
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;
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;
/**