@google-cloud/spanner 6.9.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +90 -1
- package/build/protos/protos.d.ts +245 -0
- package/build/protos/protos.js +581 -0
- package/build/protos/protos.json +73 -0
- package/build/src/common-grpc/service.js +4 -0
- package/build/src/database.d.ts +66 -0
- package/build/src/database.js +21 -0
- package/build/src/index.d.ts +2 -2
- package/build/src/session-pool.d.ts +3 -3
- package/build/src/v1/database_admin_client.d.ts +75 -48
- package/build/src/v1/database_admin_client.js +41 -20
- package/build/src/v1/database_admin_client_config.json +5 -0
- package/build/src/v1/instance_admin_client.d.ts +0 -36
- package/build/src/v1/instance_admin_client.js +0 -14
- package/package.json +2 -2
package/build/protos/protos.json
CHANGED
|
@@ -1883,6 +1883,34 @@
|
|
|
1883
1883
|
}
|
|
1884
1884
|
]
|
|
1885
1885
|
},
|
|
1886
|
+
"UpdateDatabase": {
|
|
1887
|
+
"requestType": "UpdateDatabaseRequest",
|
|
1888
|
+
"responseType": "google.longrunning.Operation",
|
|
1889
|
+
"options": {
|
|
1890
|
+
"(google.api.http).patch": "/v1/{database.name=projects/*/instances/*/databases/*}",
|
|
1891
|
+
"(google.api.http).body": "database",
|
|
1892
|
+
"(google.api.method_signature)": "database,update_mask",
|
|
1893
|
+
"(google.longrunning.operation_info).response_type": "Database",
|
|
1894
|
+
"(google.longrunning.operation_info).metadata_type": "UpdateDatabaseMetadata"
|
|
1895
|
+
},
|
|
1896
|
+
"parsedOptions": [
|
|
1897
|
+
{
|
|
1898
|
+
"(google.api.http)": {
|
|
1899
|
+
"patch": "/v1/{database.name=projects/*/instances/*/databases/*}",
|
|
1900
|
+
"body": "database"
|
|
1901
|
+
}
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"(google.api.method_signature)": "database,update_mask"
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
"(google.longrunning.operation_info)": {
|
|
1908
|
+
"response_type": "Database",
|
|
1909
|
+
"metadata_type": "UpdateDatabaseMetadata"
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
]
|
|
1913
|
+
},
|
|
1886
1914
|
"UpdateDatabaseDdl": {
|
|
1887
1915
|
"requestType": "UpdateDatabaseDdlRequest",
|
|
1888
1916
|
"responseType": "google.longrunning.Operation",
|
|
@@ -2340,6 +2368,17 @@
|
|
|
2340
2368
|
"options": {
|
|
2341
2369
|
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2342
2370
|
}
|
|
2371
|
+
},
|
|
2372
|
+
"enableDropProtection": {
|
|
2373
|
+
"type": "bool",
|
|
2374
|
+
"id": 11
|
|
2375
|
+
},
|
|
2376
|
+
"reconciling": {
|
|
2377
|
+
"type": "bool",
|
|
2378
|
+
"id": 12,
|
|
2379
|
+
"options": {
|
|
2380
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2381
|
+
}
|
|
2343
2382
|
}
|
|
2344
2383
|
},
|
|
2345
2384
|
"nested": {
|
|
@@ -2450,6 +2489,40 @@
|
|
|
2450
2489
|
}
|
|
2451
2490
|
}
|
|
2452
2491
|
},
|
|
2492
|
+
"UpdateDatabaseRequest": {
|
|
2493
|
+
"fields": {
|
|
2494
|
+
"database": {
|
|
2495
|
+
"type": "Database",
|
|
2496
|
+
"id": 1,
|
|
2497
|
+
"options": {
|
|
2498
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2499
|
+
}
|
|
2500
|
+
},
|
|
2501
|
+
"updateMask": {
|
|
2502
|
+
"type": "google.protobuf.FieldMask",
|
|
2503
|
+
"id": 2,
|
|
2504
|
+
"options": {
|
|
2505
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2510
|
+
"UpdateDatabaseMetadata": {
|
|
2511
|
+
"fields": {
|
|
2512
|
+
"request": {
|
|
2513
|
+
"type": "UpdateDatabaseRequest",
|
|
2514
|
+
"id": 1
|
|
2515
|
+
},
|
|
2516
|
+
"progress": {
|
|
2517
|
+
"type": "OperationProgress",
|
|
2518
|
+
"id": 2
|
|
2519
|
+
},
|
|
2520
|
+
"cancelTime": {
|
|
2521
|
+
"type": "google.protobuf.Timestamp",
|
|
2522
|
+
"id": 3
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
},
|
|
2453
2526
|
"UpdateDatabaseDdlRequest": {
|
|
2454
2527
|
"fields": {
|
|
2455
2528
|
"database": {
|
|
@@ -307,6 +307,10 @@ class GrpcService extends common_1.Service {
|
|
|
307
307
|
}
|
|
308
308
|
this.maxRetries = options.maxRetries;
|
|
309
309
|
this.userAgent = common_1.util.getUserAgentFromPackageJson(config.packageJson);
|
|
310
|
+
if (this.providedUserAgent) {
|
|
311
|
+
this.userAgent = `${this.providedUserAgent} ${this.userAgent}`;
|
|
312
|
+
}
|
|
313
|
+
options['grpc.primary_user_agent'] = this.userAgent;
|
|
310
314
|
this.activeServiceMap_ = new Map();
|
|
311
315
|
this.protos = {};
|
|
312
316
|
const protoServices = config.protoServices;
|
package/build/src/database.d.ts
CHANGED
|
@@ -34,8 +34,11 @@ import { EnumKey, RequestConfig, TranslateEnumKeys } from '.';
|
|
|
34
34
|
import IPolicy = google.iam.v1.IPolicy;
|
|
35
35
|
import Policy = google.iam.v1.Policy;
|
|
36
36
|
import FieldMask = google.protobuf.FieldMask;
|
|
37
|
+
import IDatabase = google.spanner.admin.database.v1.IDatabase;
|
|
37
38
|
export type GetDatabaseRolesCallback = RequestCallback<IDatabaseRole, databaseAdmin.spanner.admin.database.v1.IListDatabaseRolesResponse>;
|
|
38
39
|
export type GetDatabaseRolesResponse = PagedResponse<IDatabaseRole, databaseAdmin.spanner.admin.database.v1.IListDatabaseRolesResponse>;
|
|
40
|
+
type SetDatabaseMetadataCallback = ResourceCallback<GaxOperation, IOperation>;
|
|
41
|
+
type SetDatabaseMetadataResponse = [GaxOperation, IOperation];
|
|
39
42
|
type IDatabaseRole = databaseAdmin.spanner.admin.database.v1.IDatabaseRole;
|
|
40
43
|
type CreateBatchTransactionCallback = ResourceCallback<BatchTransaction, google.spanner.v1.ITransaction | google.spanner.v1.ISession>;
|
|
41
44
|
type CreateBatchTransactionResponse = [
|
|
@@ -164,6 +167,69 @@ declare class Database extends common.GrpcServiceObject {
|
|
|
164
167
|
request: DatabaseRequest;
|
|
165
168
|
databaseRole?: string | null;
|
|
166
169
|
constructor(instance: Instance, name: string, poolOptions?: SessionPoolConstructor | SessionPoolOptions, queryOptions?: spannerClient.spanner.v1.ExecuteSqlRequest.IQueryOptions);
|
|
170
|
+
/**
|
|
171
|
+
* @typedef {array} SetDatabaseMetadataResponse
|
|
172
|
+
* @property {object} 0 The {@link Database} metadata.
|
|
173
|
+
* @property {object} 1 The full API response.
|
|
174
|
+
*/
|
|
175
|
+
/**
|
|
176
|
+
* @callback SetDatabaseMetadataCallback
|
|
177
|
+
* @param {?Error} err Request error, if any.
|
|
178
|
+
* @param {object} metadata The {@link Database} metadata.
|
|
179
|
+
* @param {object} apiResponse The full API response.
|
|
180
|
+
*/
|
|
181
|
+
/**
|
|
182
|
+
* Update the metadata for this database. Note that this method follows PATCH
|
|
183
|
+
* semantics, so previously-configured settings will persist.
|
|
184
|
+
*
|
|
185
|
+
* Wrapper around {@link v1.DatabaseAdminClient#updateDatabase}.
|
|
186
|
+
*
|
|
187
|
+
* @see {@link v1.DatabaseAdminClient#updateDatabase}
|
|
188
|
+
* @see [UpdateDatabase API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase)
|
|
189
|
+
*
|
|
190
|
+
* @param {object} metadata The metadata you wish to set.
|
|
191
|
+
* @param {object} [gaxOptions] Request configuration options,
|
|
192
|
+
* See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
|
|
193
|
+
* for more details.
|
|
194
|
+
* @param {SetDatabaseMetadataCallback} [callback] Callback function.
|
|
195
|
+
* @returns {Promise<SetDatabaseMetadataResponse>}
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```
|
|
199
|
+
* const {Spanner} = require('@google-cloud/spanner');
|
|
200
|
+
* const spanner = new Spanner();
|
|
201
|
+
*
|
|
202
|
+
* const instance = spanner.instance('my-instance');
|
|
203
|
+
* const database = instance.database('my-database');
|
|
204
|
+
*
|
|
205
|
+
* const metadata = {
|
|
206
|
+
* enableDropProtection: true
|
|
207
|
+
* };
|
|
208
|
+
*
|
|
209
|
+
* database.setMetadata(metadata, function(err, operation, apiResponse) {
|
|
210
|
+
* if (err) {
|
|
211
|
+
* // Error handling omitted.
|
|
212
|
+
* }
|
|
213
|
+
*
|
|
214
|
+
* operation
|
|
215
|
+
* .on('error', function(err) {})
|
|
216
|
+
* .on('complete', function() {
|
|
217
|
+
* // Metadata updated successfully.
|
|
218
|
+
* });
|
|
219
|
+
* });
|
|
220
|
+
*
|
|
221
|
+
* //-
|
|
222
|
+
* // If the callback is omitted, we'll return a Promise.
|
|
223
|
+
* //-
|
|
224
|
+
* database.setMetadata(metadata).then(function(data) {
|
|
225
|
+
* const operation = data[0];
|
|
226
|
+
* const apiResponse = data[1];
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
setMetadata(metadata: IDatabase, gaxOptions?: CallOptions): Promise<SetDatabaseMetadataResponse>;
|
|
231
|
+
setMetadata(metadata: IDatabase, callback: SetDatabaseMetadataCallback): void;
|
|
232
|
+
setMetadata(metadata: IDatabase, gaxOptions: CallOptions, callback: SetDatabaseMetadataCallback): void;
|
|
167
233
|
static getEnvironmentQueryOptions(): databaseAdmin.spanner.v1.ExecuteSqlRequest.IQueryOptions;
|
|
168
234
|
/**
|
|
169
235
|
* @typedef {object} BatchCreateSessionsOptions
|
package/build/src/database.js
CHANGED
|
@@ -31,6 +31,7 @@ const table_1 = require("./table");
|
|
|
31
31
|
const transaction_runner_1 = require("./transaction-runner");
|
|
32
32
|
const common_1 = require("./common");
|
|
33
33
|
const arrify = require("arrify");
|
|
34
|
+
const snakeCase = require("lodash.snakecase");
|
|
34
35
|
/**
|
|
35
36
|
* Create a Database object to interact with a Cloud Spanner database.
|
|
36
37
|
*
|
|
@@ -156,6 +157,25 @@ class Database extends common.GrpcServiceObject {
|
|
|
156
157
|
this.pool_.open();
|
|
157
158
|
this.queryOptions_ = Object.assign(Object.assign({}, queryOptions), Database.getEnvironmentQueryOptions());
|
|
158
159
|
}
|
|
160
|
+
setMetadata(metadata, optionsOrCallback, cb) {
|
|
161
|
+
const gaxOpts = typeof optionsOrCallback === 'object' ? optionsOrCallback : {};
|
|
162
|
+
const callback = typeof optionsOrCallback === 'function' ? optionsOrCallback : cb;
|
|
163
|
+
const reqOpts = {
|
|
164
|
+
database: extend({
|
|
165
|
+
name: this.formattedName_,
|
|
166
|
+
}, metadata),
|
|
167
|
+
updateMask: {
|
|
168
|
+
paths: Object.keys(metadata).map(snakeCase),
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
return this.request({
|
|
172
|
+
client: 'DatabaseAdminClient',
|
|
173
|
+
method: 'updateDatabase',
|
|
174
|
+
reqOpts,
|
|
175
|
+
gaxOpts,
|
|
176
|
+
headers: this.resourceHeader_,
|
|
177
|
+
}, callback);
|
|
178
|
+
}
|
|
159
179
|
static getEnvironmentQueryOptions() {
|
|
160
180
|
const options = {};
|
|
161
181
|
if (process.env.SPANNER_OPTIMIZER_VERSION) {
|
|
@@ -1243,6 +1263,7 @@ exports.Database = Database;
|
|
|
1243
1263
|
'runTransaction',
|
|
1244
1264
|
'runTransactionAsync',
|
|
1245
1265
|
'session',
|
|
1266
|
+
'setMetadata',
|
|
1246
1267
|
'table',
|
|
1247
1268
|
'updateSchema',
|
|
1248
1269
|
],
|
package/build/src/index.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ export type GetInstanceConfigOperationsResponse = PagedResponse<IOperation, inst
|
|
|
48
48
|
export type GetInstanceConfigOperationsCallback = PagedCallback<IOperation, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse>;
|
|
49
49
|
/**
|
|
50
50
|
* Session pool configuration options.
|
|
51
|
-
* @property {boolean} [routeToLeaderEnabled=
|
|
52
|
-
*
|
|
51
|
+
* @property {boolean} [routeToLeaderEnabled=False] If set to true leader aware routing will be enabled.
|
|
52
|
+
* Enabling leader aware routing would route all requests in RW/PDML transactions to leader region.
|
|
53
53
|
*/
|
|
54
54
|
export interface SpannerOptions extends GrpcClientOptions {
|
|
55
55
|
apiEndpoint?: string;
|
|
@@ -111,13 +111,13 @@ export interface SessionPoolInterface extends EventEmitter {
|
|
|
111
111
|
* @property {number} [acquireTimeout=Infinity] Time in milliseconds before
|
|
112
112
|
* giving up trying to acquire a session. If the specified value is
|
|
113
113
|
* `Infinity`, a timeout will not occur.
|
|
114
|
-
* @property {number} [concurrency=
|
|
114
|
+
* @property {number} [concurrency=Infinity] How many concurrent requests the pool is
|
|
115
115
|
* allowed to make.
|
|
116
116
|
* @property {boolean} [fail=false] If set to true, an error will be thrown when
|
|
117
117
|
* there are no available sessions for a request.
|
|
118
118
|
* @property {number} [idlesAfter=10] How long until a resource becomes idle, in
|
|
119
119
|
* minutes.
|
|
120
|
-
* @property {number} [keepAlive=
|
|
120
|
+
* @property {number} [keepAlive=30] How often to ping idle sessions, in
|
|
121
121
|
* minutes. Must be less than 1 hour.
|
|
122
122
|
* @property {Object<string, string>} [labels] Labels to apply to any session
|
|
123
123
|
* created by the pool.
|
|
@@ -125,7 +125,7 @@ export interface SessionPoolInterface extends EventEmitter {
|
|
|
125
125
|
* given time.
|
|
126
126
|
* @property {number} [maxIdle=1] Maximum number of idle resources to keep in
|
|
127
127
|
* the pool at any given time.
|
|
128
|
-
* @property {number} [min=
|
|
128
|
+
* @property {number} [min=25] Minimum number of resources to keep in the pool at
|
|
129
129
|
* any given time.
|
|
130
130
|
* @property {number} [writes=0.0]. Deprecated.
|
|
131
131
|
* @property {number} [incStep=25] The number of new sessions to create when at
|
|
@@ -129,8 +129,6 @@ export declare class DatabaseAdminClient {
|
|
|
129
129
|
* Please see the
|
|
130
130
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
131
131
|
* for more details and examples.
|
|
132
|
-
* @example <caption>include:samples/generated/v1/database_admin.get_database.js</caption>
|
|
133
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_GetDatabase_async
|
|
134
132
|
*/
|
|
135
133
|
getDatabase(request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options?: CallOptions): Promise<[
|
|
136
134
|
protos.google.spanner.admin.database.v1.IDatabase,
|
|
@@ -157,8 +155,6 @@ export declare class DatabaseAdminClient {
|
|
|
157
155
|
* Please see the
|
|
158
156
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
159
157
|
* for more details and examples.
|
|
160
|
-
* @example <caption>include:samples/generated/v1/database_admin.drop_database.js</caption>
|
|
161
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_DropDatabase_async
|
|
162
158
|
*/
|
|
163
159
|
dropDatabase(request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options?: CallOptions): Promise<[
|
|
164
160
|
protos.google.protobuf.IEmpty,
|
|
@@ -185,8 +181,6 @@ export declare class DatabaseAdminClient {
|
|
|
185
181
|
* Please see the
|
|
186
182
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
187
183
|
* for more details and examples.
|
|
188
|
-
* @example <caption>include:samples/generated/v1/database_admin.get_database_ddl.js</caption>
|
|
189
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_async
|
|
190
184
|
*/
|
|
191
185
|
getDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options?: CallOptions): Promise<[
|
|
192
186
|
protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse,
|
|
@@ -227,8 +221,6 @@ export declare class DatabaseAdminClient {
|
|
|
227
221
|
* Please see the
|
|
228
222
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
229
223
|
* for more details and examples.
|
|
230
|
-
* @example <caption>include:samples/generated/v1/database_admin.set_iam_policy.js</caption>
|
|
231
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_SetIamPolicy_async
|
|
232
224
|
*/
|
|
233
225
|
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
234
226
|
protos.google.iam.v1.IPolicy,
|
|
@@ -262,8 +254,6 @@ export declare class DatabaseAdminClient {
|
|
|
262
254
|
* Please see the
|
|
263
255
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
264
256
|
* for more details and examples.
|
|
265
|
-
* @example <caption>include:samples/generated/v1/database_admin.get_iam_policy.js</caption>
|
|
266
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_GetIamPolicy_async
|
|
267
257
|
*/
|
|
268
258
|
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
269
259
|
protos.google.iam.v1.IPolicy,
|
|
@@ -301,8 +291,6 @@ export declare class DatabaseAdminClient {
|
|
|
301
291
|
* Please see the
|
|
302
292
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
303
293
|
* for more details and examples.
|
|
304
|
-
* @example <caption>include:samples/generated/v1/database_admin.test_iam_permissions.js</caption>
|
|
305
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_TestIamPermissions_async
|
|
306
294
|
*/
|
|
307
295
|
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
|
|
308
296
|
protos.google.iam.v1.ITestIamPermissionsResponse,
|
|
@@ -327,8 +315,6 @@ export declare class DatabaseAdminClient {
|
|
|
327
315
|
* Please see the
|
|
328
316
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
329
317
|
* for more details and examples.
|
|
330
|
-
* @example <caption>include:samples/generated/v1/database_admin.get_backup.js</caption>
|
|
331
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_GetBackup_async
|
|
332
318
|
*/
|
|
333
319
|
getBackup(request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, options?: CallOptions): Promise<[
|
|
334
320
|
protos.google.spanner.admin.database.v1.IBackup,
|
|
@@ -360,8 +346,6 @@ export declare class DatabaseAdminClient {
|
|
|
360
346
|
* Please see the
|
|
361
347
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
362
348
|
* for more details and examples.
|
|
363
|
-
* @example <caption>include:samples/generated/v1/database_admin.update_backup.js</caption>
|
|
364
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_UpdateBackup_async
|
|
365
349
|
*/
|
|
366
350
|
updateBackup(request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options?: CallOptions): Promise<[
|
|
367
351
|
protos.google.spanner.admin.database.v1.IBackup,
|
|
@@ -386,8 +370,6 @@ export declare class DatabaseAdminClient {
|
|
|
386
370
|
* Please see the
|
|
387
371
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
388
372
|
* for more details and examples.
|
|
389
|
-
* @example <caption>include:samples/generated/v1/database_admin.delete_backup.js</caption>
|
|
390
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_DeleteBackup_async
|
|
391
373
|
*/
|
|
392
374
|
deleteBackup(request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options?: CallOptions): Promise<[
|
|
393
375
|
protos.google.protobuf.IEmpty,
|
|
@@ -437,8 +419,6 @@ export declare class DatabaseAdminClient {
|
|
|
437
419
|
* Please see the
|
|
438
420
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
439
421
|
* for more details and examples.
|
|
440
|
-
* @example <caption>include:samples/generated/v1/database_admin.create_database.js</caption>
|
|
441
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
|
|
442
422
|
*/
|
|
443
423
|
createDatabase(request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options?: CallOptions): Promise<[
|
|
444
424
|
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>,
|
|
@@ -456,10 +436,83 @@ export declare class DatabaseAdminClient {
|
|
|
456
436
|
* Please see the
|
|
457
437
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
458
438
|
* for more details and examples.
|
|
459
|
-
* @example <caption>include:samples/generated/v1/database_admin.create_database.js</caption>
|
|
460
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
|
|
461
439
|
*/
|
|
462
440
|
checkCreateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>>;
|
|
441
|
+
/**
|
|
442
|
+
* Updates a Cloud Spanner database. The returned
|
|
443
|
+
* {@link google.longrunning.Operation|long-running operation} can be used to track
|
|
444
|
+
* the progress of updating the database. If the named database does not
|
|
445
|
+
* exist, returns `NOT_FOUND`.
|
|
446
|
+
*
|
|
447
|
+
* While the operation is pending:
|
|
448
|
+
*
|
|
449
|
+
* * The database's
|
|
450
|
+
* {@link google.spanner.admin.database.v1.Database.reconciling|reconciling}
|
|
451
|
+
* field is set to true.
|
|
452
|
+
* * Cancelling the operation is best-effort. If the cancellation succeeds,
|
|
453
|
+
* the operation metadata's
|
|
454
|
+
* {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time|cancel_time}
|
|
455
|
+
* is set, the updates are reverted, and the operation terminates with a
|
|
456
|
+
* `CANCELLED` status.
|
|
457
|
+
* * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
|
|
458
|
+
* until the pending operation is done (returns successfully or with
|
|
459
|
+
* error).
|
|
460
|
+
* * Reading the database via the API continues to give the pre-request
|
|
461
|
+
* values.
|
|
462
|
+
*
|
|
463
|
+
* Upon completion of the returned operation:
|
|
464
|
+
*
|
|
465
|
+
* * The new values are in effect and readable via the API.
|
|
466
|
+
* * The database's
|
|
467
|
+
* {@link google.spanner.admin.database.v1.Database.reconciling|reconciling}
|
|
468
|
+
* field becomes false.
|
|
469
|
+
*
|
|
470
|
+
* The returned {@link google.longrunning.Operation|long-running operation} will
|
|
471
|
+
* have a name of the format
|
|
472
|
+
* `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
|
|
473
|
+
* and can be used to track the database modification. The
|
|
474
|
+
* {@link google.longrunning.Operation.metadata|metadata} field type is
|
|
475
|
+
* {@link google.spanner.admin.database.v1.UpdateDatabaseMetadata|UpdateDatabaseMetadata}.
|
|
476
|
+
* The {@link google.longrunning.Operation.response|response} field type is
|
|
477
|
+
* {@link google.spanner.admin.database.v1.Database|Database}, if successful.
|
|
478
|
+
*
|
|
479
|
+
* @param {Object} request
|
|
480
|
+
* The request object that will be sent.
|
|
481
|
+
* @param {google.spanner.admin.database.v1.Database} request.database
|
|
482
|
+
* Required. The database to update.
|
|
483
|
+
* The `name` field of the database is of the form
|
|
484
|
+
* `projects/<project>/instances/<instance>/databases/<database>`.
|
|
485
|
+
* @param {google.protobuf.FieldMask} request.updateMask
|
|
486
|
+
* Required. The list of fields to update. Currently, only
|
|
487
|
+
* `enable_drop_protection` field can be updated.
|
|
488
|
+
* @param {object} [options]
|
|
489
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
490
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
491
|
+
* The first element of the array is an object representing
|
|
492
|
+
* a long running operation. Its `promise()` method returns a promise
|
|
493
|
+
* you can `await` for.
|
|
494
|
+
* Please see the
|
|
495
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
496
|
+
* for more details and examples.
|
|
497
|
+
*/
|
|
498
|
+
updateDatabase(request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseRequest, options?: CallOptions): Promise<[
|
|
499
|
+
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IUpdateDatabaseMetadata>,
|
|
500
|
+
protos.google.longrunning.IOperation | undefined,
|
|
501
|
+
{} | undefined
|
|
502
|
+
]>;
|
|
503
|
+
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;
|
|
504
|
+
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;
|
|
505
|
+
/**
|
|
506
|
+
* Check the status of the long running operation returned by `updateDatabase()`.
|
|
507
|
+
* @param {String} name
|
|
508
|
+
* The operation name that will be passed.
|
|
509
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
510
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
511
|
+
* Please see the
|
|
512
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
513
|
+
* for more details and examples.
|
|
514
|
+
*/
|
|
515
|
+
checkUpdateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.UpdateDatabaseMetadata>>;
|
|
463
516
|
/**
|
|
464
517
|
* Updates the schema of a Cloud Spanner database by
|
|
465
518
|
* creating/altering/dropping tables, columns, indexes, etc. The returned
|
|
@@ -504,8 +557,6 @@ export declare class DatabaseAdminClient {
|
|
|
504
557
|
* Please see the
|
|
505
558
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
506
559
|
* for more details and examples.
|
|
507
|
-
* @example <caption>include:samples/generated/v1/database_admin.update_database_ddl.js</caption>
|
|
508
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
|
|
509
560
|
*/
|
|
510
561
|
updateDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options?: CallOptions): Promise<[
|
|
511
562
|
LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>,
|
|
@@ -523,8 +574,6 @@ export declare class DatabaseAdminClient {
|
|
|
523
574
|
* Please see the
|
|
524
575
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
525
576
|
* for more details and examples.
|
|
526
|
-
* @example <caption>include:samples/generated/v1/database_admin.update_database_ddl.js</caption>
|
|
527
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
|
|
528
577
|
*/
|
|
529
578
|
checkUpdateDatabaseDdlProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>>;
|
|
530
579
|
/**
|
|
@@ -571,8 +620,6 @@ export declare class DatabaseAdminClient {
|
|
|
571
620
|
* Please see the
|
|
572
621
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
573
622
|
* for more details and examples.
|
|
574
|
-
* @example <caption>include:samples/generated/v1/database_admin.create_backup.js</caption>
|
|
575
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
|
|
576
623
|
*/
|
|
577
624
|
createBackup(request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options?: CallOptions): Promise<[
|
|
578
625
|
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>,
|
|
@@ -590,8 +637,6 @@ export declare class DatabaseAdminClient {
|
|
|
590
637
|
* Please see the
|
|
591
638
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
592
639
|
* for more details and examples.
|
|
593
|
-
* @example <caption>include:samples/generated/v1/database_admin.create_backup.js</caption>
|
|
594
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
|
|
595
640
|
*/
|
|
596
641
|
checkCreateBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CreateBackupMetadata>>;
|
|
597
642
|
/**
|
|
@@ -645,8 +690,6 @@ export declare class DatabaseAdminClient {
|
|
|
645
690
|
* Please see the
|
|
646
691
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
647
692
|
* for more details and examples.
|
|
648
|
-
* @example <caption>include:samples/generated/v1/database_admin.copy_backup.js</caption>
|
|
649
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CopyBackup_async
|
|
650
693
|
*/
|
|
651
694
|
copyBackup(request?: protos.google.spanner.admin.database.v1.ICopyBackupRequest, options?: CallOptions): Promise<[
|
|
652
695
|
LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICopyBackupMetadata>,
|
|
@@ -664,8 +707,6 @@ export declare class DatabaseAdminClient {
|
|
|
664
707
|
* Please see the
|
|
665
708
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
666
709
|
* for more details and examples.
|
|
667
|
-
* @example <caption>include:samples/generated/v1/database_admin.copy_backup.js</caption>
|
|
668
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_CopyBackup_async
|
|
669
710
|
*/
|
|
670
711
|
checkCopyBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CopyBackupMetadata>>;
|
|
671
712
|
/**
|
|
@@ -719,8 +760,6 @@ export declare class DatabaseAdminClient {
|
|
|
719
760
|
* Please see the
|
|
720
761
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
721
762
|
* for more details and examples.
|
|
722
|
-
* @example <caption>include:samples/generated/v1/database_admin.restore_database.js</caption>
|
|
723
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
|
|
724
763
|
*/
|
|
725
764
|
restoreDatabase(request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options?: CallOptions): Promise<[
|
|
726
765
|
LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>,
|
|
@@ -738,8 +777,6 @@ export declare class DatabaseAdminClient {
|
|
|
738
777
|
* Please see the
|
|
739
778
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
740
779
|
* for more details and examples.
|
|
741
|
-
* @example <caption>include:samples/generated/v1/database_admin.restore_database.js</caption>
|
|
742
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
|
|
743
780
|
*/
|
|
744
781
|
checkRestoreDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata>>;
|
|
745
782
|
/**
|
|
@@ -830,8 +867,6 @@ export declare class DatabaseAdminClient {
|
|
|
830
867
|
* Please see the
|
|
831
868
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
832
869
|
* for more details and examples.
|
|
833
|
-
* @example <caption>include:samples/generated/v1/database_admin.list_databases.js</caption>
|
|
834
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabases_async
|
|
835
870
|
*/
|
|
836
871
|
listDatabasesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase>;
|
|
837
872
|
/**
|
|
@@ -1035,8 +1070,6 @@ export declare class DatabaseAdminClient {
|
|
|
1035
1070
|
* Please see the
|
|
1036
1071
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1037
1072
|
* for more details and examples.
|
|
1038
|
-
* @example <caption>include:samples/generated/v1/database_admin.list_backups.js</caption>
|
|
1039
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackups_async
|
|
1040
1073
|
*/
|
|
1041
1074
|
listBackupsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IBackup>;
|
|
1042
1075
|
/**
|
|
@@ -1266,8 +1299,6 @@ export declare class DatabaseAdminClient {
|
|
|
1266
1299
|
* Please see the
|
|
1267
1300
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1268
1301
|
* for more details and examples.
|
|
1269
|
-
* @example <caption>include:samples/generated/v1/database_admin.list_database_operations.js</caption>
|
|
1270
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_async
|
|
1271
1302
|
*/
|
|
1272
1303
|
listDatabaseOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
|
|
1273
1304
|
/**
|
|
@@ -1571,8 +1602,6 @@ export declare class DatabaseAdminClient {
|
|
|
1571
1602
|
* Please see the
|
|
1572
1603
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1573
1604
|
* for more details and examples.
|
|
1574
|
-
* @example <caption>include:samples/generated/v1/database_admin.list_backup_operations.js</caption>
|
|
1575
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackupOperations_async
|
|
1576
1605
|
*/
|
|
1577
1606
|
listBackupOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
|
|
1578
1607
|
/**
|
|
@@ -1666,8 +1695,6 @@ export declare class DatabaseAdminClient {
|
|
|
1666
1695
|
* Please see the
|
|
1667
1696
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1668
1697
|
* for more details and examples.
|
|
1669
|
-
* @example <caption>include:samples/generated/v1/database_admin.list_database_roles.js</caption>
|
|
1670
|
-
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_async
|
|
1671
1698
|
*/
|
|
1672
1699
|
listDatabaseRolesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseRolesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabaseRole>;
|
|
1673
1700
|
/**
|