@google-cloud/spanner 7.5.0 → 7.6.0

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 CHANGED
@@ -4,6 +4,16 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ## [7.6.0](https://github.com/googleapis/nodejs-spanner/compare/v7.5.0...v7.6.0) (2024-03-26)
8
+
9
+
10
+ ### Features
11
+
12
+ * Add instance partition support to spanner instance proto ([#2001](https://github.com/googleapis/nodejs-spanner/issues/2001)) ([4381047](https://github.com/googleapis/nodejs-spanner/commit/43810478e81d3a234e7fa94af90fd49ca379dd98))
13
+ * Managed Autoscaler ([#2015](https://github.com/googleapis/nodejs-spanner/issues/2015)) ([547ca1b](https://github.com/googleapis/nodejs-spanner/commit/547ca1b0da8c5c5e28f85fbd4ea16af21e20c980))
14
+ * **spanner:** Add a sample for max commit delays ([#1993](https://github.com/googleapis/nodejs-spanner/issues/1993)) ([91c7204](https://github.com/googleapis/nodejs-spanner/commit/91c7204e2c8f62e229d7a2b2a0ff059d421dd984))
15
+ * **spanner:** Add support for float32 ([#2020](https://github.com/googleapis/nodejs-spanner/issues/2020)) ([99e2c1d](https://github.com/googleapis/nodejs-spanner/commit/99e2c1d4791a5ca86fdccb3f600aa4592efe0a45))
16
+
7
17
  ## [7.5.0](https://github.com/googleapis/nodejs-spanner/compare/v7.4.0...v7.5.0) (2024-03-04)
8
18
 
9
19
 
package/README.md CHANGED
@@ -131,6 +131,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
131
131
  | Deletes a user-managed instance configuration. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-config-delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-config-delete.js,samples/README.md) |
132
132
  | Lists the instance configuration operations. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-config-get-operations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-config-get-operations.js,samples/README.md) |
133
133
  | Updates a user-managed instance configuration. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-config-update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-config-update.js,samples/README.md) |
134
+ | Creates a instance with autoscaling config. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-with-autoscaling-config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-with-autoscaling-config.js,samples/README.md) |
134
135
  | Instance-with-processing-units | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-with-processing-units.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-with-processing-units.js,samples/README.md) |
135
136
  | Instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance.js,samples/README.md) |
136
137
  | Json-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-add-column.js,samples/README.md) |
@@ -138,6 +139,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
138
139
  | Json-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-update-data.js,samples/README.md) |
139
140
  | Lists all databases on the selected instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-databases.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-databases.js,samples/README.md) |
140
141
  | Lists all the available instance configs for the selected project. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-instance-configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-instance-configs.js,samples/README.md) |
142
+ | Executes request with max commit delay | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/max-commit-delay.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/max-commit-delay.js,samples/README.md) |
141
143
  | Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) |
142
144
  | Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) |
143
145
  | Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) |
@@ -1,4 +1,4 @@
1
- // Copyright 2022 Google LLC
1
+ // Copyright 2024 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -235,6 +235,15 @@ service InstanceAdmin {
235
235
  option (google.api.method_signature) = "parent";
236
236
  }
237
237
 
238
+ // Lists all instance partitions for the given instance.
239
+ rpc ListInstancePartitions(ListInstancePartitionsRequest)
240
+ returns (ListInstancePartitionsResponse) {
241
+ option (google.api.http) = {
242
+ get: "/v1/{parent=projects/*/instances/*}/instancePartitions"
243
+ };
244
+ option (google.api.method_signature) = "parent";
245
+ }
246
+
238
247
  // Gets information about a particular instance.
239
248
  rpc GetInstance(GetInstanceRequest) returns (Instance) {
240
249
  option (google.api.http) = {
@@ -403,6 +412,161 @@ service InstanceAdmin {
403
412
  };
404
413
  option (google.api.method_signature) = "resource,permissions";
405
414
  }
415
+
416
+ // Gets information about a particular instance partition.
417
+ rpc GetInstancePartition(GetInstancePartitionRequest)
418
+ returns (InstancePartition) {
419
+ option (google.api.http) = {
420
+ get: "/v1/{name=projects/*/instances/*/instancePartitions/*}"
421
+ };
422
+ option (google.api.method_signature) = "name";
423
+ }
424
+
425
+ // Creates an instance partition and begins preparing it to be used. The
426
+ // returned [long-running operation][google.longrunning.Operation]
427
+ // can be used to track the progress of preparing the new instance partition.
428
+ // The instance partition name is assigned by the caller. If the named
429
+ // instance partition already exists, `CreateInstancePartition` returns
430
+ // `ALREADY_EXISTS`.
431
+ //
432
+ // Immediately upon completion of this request:
433
+ //
434
+ // * The instance partition is readable via the API, with all requested
435
+ // attributes but no allocated resources. Its state is `CREATING`.
436
+ //
437
+ // Until completion of the returned operation:
438
+ //
439
+ // * Cancelling the operation renders the instance partition immediately
440
+ // unreadable via the API.
441
+ // * The instance partition can be deleted.
442
+ // * All other attempts to modify the instance partition are rejected.
443
+ //
444
+ // Upon completion of the returned operation:
445
+ //
446
+ // * Billing for all successfully-allocated resources begins (some types
447
+ // may have lower than the requested levels).
448
+ // * Databases can start using this instance partition.
449
+ // * The instance partition's allocated resource levels are readable via the
450
+ // API.
451
+ // * The instance partition's state becomes `READY`.
452
+ //
453
+ // The returned [long-running operation][google.longrunning.Operation] will
454
+ // have a name of the format
455
+ // `<instance_partition_name>/operations/<operation_id>` and can be used to
456
+ // track creation of the instance partition. The
457
+ // [metadata][google.longrunning.Operation.metadata] field type is
458
+ // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
459
+ // The [response][google.longrunning.Operation.response] field type is
460
+ // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
461
+ // successful.
462
+ rpc CreateInstancePartition(CreateInstancePartitionRequest)
463
+ returns (google.longrunning.Operation) {
464
+ option (google.api.http) = {
465
+ post: "/v1/{parent=projects/*/instances/*}/instancePartitions"
466
+ body: "*"
467
+ };
468
+ option (google.api.method_signature) =
469
+ "parent,instance_partition,instance_partition_id";
470
+ option (google.longrunning.operation_info) = {
471
+ response_type: "google.spanner.admin.instance.v1.InstancePartition"
472
+ metadata_type: "google.spanner.admin.instance.v1.CreateInstancePartitionMetadata"
473
+ };
474
+ }
475
+
476
+ // Deletes an existing instance partition. Requires that the
477
+ // instance partition is not used by any database or backup and is not the
478
+ // default instance partition of an instance.
479
+ //
480
+ // Authorization requires `spanner.instancePartitions.delete` permission on
481
+ // the resource
482
+ // [name][google.spanner.admin.instance.v1.InstancePartition.name].
483
+ rpc DeleteInstancePartition(DeleteInstancePartitionRequest)
484
+ returns (google.protobuf.Empty) {
485
+ option (google.api.http) = {
486
+ delete: "/v1/{name=projects/*/instances/*/instancePartitions/*}"
487
+ };
488
+ option (google.api.method_signature) = "name";
489
+ }
490
+
491
+ // Updates an instance partition, and begins allocating or releasing resources
492
+ // as requested. The returned [long-running
493
+ // operation][google.longrunning.Operation] can be used to track the
494
+ // progress of updating the instance partition. If the named instance
495
+ // partition does not exist, returns `NOT_FOUND`.
496
+ //
497
+ // Immediately upon completion of this request:
498
+ //
499
+ // * For resource types for which a decrease in the instance partition's
500
+ // allocation has been requested, billing is based on the newly-requested
501
+ // level.
502
+ //
503
+ // Until completion of the returned operation:
504
+ //
505
+ // * Cancelling the operation sets its metadata's
506
+ // [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time],
507
+ // and begins restoring resources to their pre-request values. The
508
+ // operation is guaranteed to succeed at undoing all resource changes,
509
+ // after which point it terminates with a `CANCELLED` status.
510
+ // * All other attempts to modify the instance partition are rejected.
511
+ // * Reading the instance partition via the API continues to give the
512
+ // pre-request resource levels.
513
+ //
514
+ // Upon completion of the returned operation:
515
+ //
516
+ // * Billing begins for all successfully-allocated resources (some types
517
+ // may have lower than the requested levels).
518
+ // * All newly-reserved resources are available for serving the instance
519
+ // partition's tables.
520
+ // * The instance partition's new resource levels are readable via the API.
521
+ //
522
+ // The returned [long-running operation][google.longrunning.Operation] will
523
+ // have a name of the format
524
+ // `<instance_partition_name>/operations/<operation_id>` and can be used to
525
+ // track the instance partition modification. The
526
+ // [metadata][google.longrunning.Operation.metadata] field type is
527
+ // [UpdateInstancePartitionMetadata][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata].
528
+ // The [response][google.longrunning.Operation.response] field type is
529
+ // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition], if
530
+ // successful.
531
+ //
532
+ // Authorization requires `spanner.instancePartitions.update` permission on
533
+ // the resource
534
+ // [name][google.spanner.admin.instance.v1.InstancePartition.name].
535
+ rpc UpdateInstancePartition(UpdateInstancePartitionRequest)
536
+ returns (google.longrunning.Operation) {
537
+ option (google.api.http) = {
538
+ patch: "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}"
539
+ body: "*"
540
+ };
541
+ option (google.api.method_signature) = "instance_partition,field_mask";
542
+ option (google.longrunning.operation_info) = {
543
+ response_type: "google.spanner.admin.instance.v1.InstancePartition"
544
+ metadata_type: "google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata"
545
+ };
546
+ }
547
+
548
+ // Lists instance partition [long-running
549
+ // operations][google.longrunning.Operation] in the given instance.
550
+ // An instance partition operation has a name of the form
551
+ // `projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>`.
552
+ // The long-running operation
553
+ // [metadata][google.longrunning.Operation.metadata] field type
554
+ // `metadata.type_url` describes the type of the metadata. Operations returned
555
+ // include those that have completed/failed/canceled within the last 7 days,
556
+ // and pending operations. Operations returned are ordered by
557
+ // `operation.metadata.value.start_time` in descending order starting from the
558
+ // most recently started operation.
559
+ //
560
+ // Authorization requires `spanner.instancePartitionOperations.list`
561
+ // permission on the resource
562
+ // [parent][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.parent].
563
+ rpc ListInstancePartitionOperations(ListInstancePartitionOperationsRequest)
564
+ returns (ListInstancePartitionOperationsResponse) {
565
+ option (google.api.http) = {
566
+ get: "/v1/{parent=projects/*/instances/*}/instancePartitionOperations"
567
+ };
568
+ option (google.api.method_signature) = "parent";
569
+ }
406
570
  }
407
571
 
408
572
  message ReplicaInfo {
@@ -1041,6 +1205,14 @@ message ListInstancesRequest {
1041
1205
  // it has the label "env" with its value
1042
1206
  // containing "dev".
1043
1207
  string filter = 4;
1208
+
1209
+ // Deadline used while retrieving metadata for instances.
1210
+ // Instances whose metadata cannot be retrieved within this deadline will be
1211
+ // added to
1212
+ // [unreachable][google.spanner.admin.instance.v1.ListInstancesResponse.unreachable]
1213
+ // in
1214
+ // [ListInstancesResponse][google.spanner.admin.instance.v1.ListInstancesResponse].
1215
+ google.protobuf.Timestamp instance_deadline = 5;
1044
1216
  }
1045
1217
 
1046
1218
  // The response for
@@ -1053,6 +1225,12 @@ message ListInstancesResponse {
1053
1225
  // [ListInstances][google.spanner.admin.instance.v1.InstanceAdmin.ListInstances]
1054
1226
  // call to fetch more of the matching instances.
1055
1227
  string next_page_token = 2;
1228
+
1229
+ // The list of unreachable instances.
1230
+ // It includes the names of instances whose metadata could not be retrieved
1231
+ // within
1232
+ // [instance_deadline][google.spanner.admin.instance.v1.ListInstancesRequest.instance_deadline].
1233
+ repeated string unreachable = 3;
1056
1234
  }
1057
1235
 
1058
1236
  // The request for
@@ -1155,3 +1333,381 @@ message UpdateInstanceConfigMetadata {
1155
1333
  // The time at which this operation was cancelled.
1156
1334
  google.protobuf.Timestamp cancel_time = 3;
1157
1335
  }
1336
+
1337
+ // An isolated set of Cloud Spanner resources that databases can define
1338
+ // placements on.
1339
+ message InstancePartition {
1340
+ option (google.api.resource) = {
1341
+ type: "spanner.googleapis.com/InstancePartition"
1342
+ pattern: "projects/{project}/instances/{instance}/instancePartitions/{instance_partition}"
1343
+ };
1344
+
1345
+ // Indicates the current state of the instance partition.
1346
+ enum State {
1347
+ // Not specified.
1348
+ STATE_UNSPECIFIED = 0;
1349
+
1350
+ // The instance partition is still being created. Resources may not be
1351
+ // available yet, and operations such as creating placements using this
1352
+ // instance partition may not work.
1353
+ CREATING = 1;
1354
+
1355
+ // The instance partition is fully created and ready to do work such as
1356
+ // creating placements and using in databases.
1357
+ READY = 2;
1358
+ }
1359
+
1360
+ // Required. A unique identifier for the instance partition. Values are of the
1361
+ // form
1362
+ // `projects/<project>/instances/<instance>/instancePartitions/[a-z][-a-z0-9]*[a-z0-9]`.
1363
+ // The final segment of the name must be between 2 and 64 characters in
1364
+ // length. An instance partition's name cannot be changed after the instance
1365
+ // partition is created.
1366
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
1367
+
1368
+ // Required. The name of the instance partition's configuration. Values are of
1369
+ // the form `projects/<project>/instanceConfigs/<configuration>`. See also
1370
+ // [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and
1371
+ // [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs].
1372
+ string config = 2 [
1373
+ (google.api.field_behavior) = REQUIRED,
1374
+ (google.api.resource_reference) = {
1375
+ type: "spanner.googleapis.com/InstanceConfig"
1376
+ }
1377
+ ];
1378
+
1379
+ // Required. The descriptive name for this instance partition as it appears in
1380
+ // UIs. Must be unique per project and between 4 and 30 characters in length.
1381
+ string display_name = 3 [(google.api.field_behavior) = REQUIRED];
1382
+
1383
+ // Compute capacity defines amount of server and storage resources that are
1384
+ // available to the databases in an instance partition. At most one of either
1385
+ // node_count or processing_units should be present in the message. See [the
1386
+ // documentation](https://cloud.google.com/spanner/docs/compute-capacity)
1387
+ // for more information about nodes and processing units.
1388
+ oneof compute_capacity {
1389
+ // The number of nodes allocated to this instance partition.
1390
+ //
1391
+ // Users can set the node_count field to specify the target number of nodes
1392
+ // allocated to the instance partition.
1393
+ //
1394
+ // This may be zero in API responses for instance partitions that are not
1395
+ // yet in state `READY`.
1396
+ int32 node_count = 5;
1397
+
1398
+ // The number of processing units allocated to this instance partition.
1399
+ //
1400
+ // Users can set the processing_units field to specify the target number of
1401
+ // processing units allocated to the instance partition.
1402
+ //
1403
+ // This may be zero in API responses for instance partitions that are not
1404
+ // yet in state `READY`.
1405
+ int32 processing_units = 6;
1406
+ }
1407
+
1408
+ // Output only. The current instance partition state.
1409
+ State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1410
+
1411
+ // Output only. The time at which the instance partition was created.
1412
+ google.protobuf.Timestamp create_time = 8
1413
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1414
+
1415
+ // Output only. The time at which the instance partition was most recently
1416
+ // updated.
1417
+ google.protobuf.Timestamp update_time = 9
1418
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1419
+
1420
+ // Output only. The names of the databases that reference this
1421
+ // instance partition. Referencing databases should share the parent instance.
1422
+ // The existence of any referencing database prevents the instance partition
1423
+ // from being deleted.
1424
+ repeated string referencing_databases = 10
1425
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1426
+
1427
+ // Output only. The names of the backups that reference this instance
1428
+ // partition. Referencing backups should share the parent instance. The
1429
+ // existence of any referencing backup prevents the instance partition from
1430
+ // being deleted.
1431
+ repeated string referencing_backups = 11
1432
+ [(google.api.field_behavior) = OUTPUT_ONLY];
1433
+
1434
+ // Used for optimistic concurrency control as a way
1435
+ // to help prevent simultaneous updates of a instance partition from
1436
+ // overwriting each other. It is strongly suggested that systems make use of
1437
+ // the etag in the read-modify-write cycle to perform instance partition
1438
+ // updates in order to avoid race conditions: An etag is returned in the
1439
+ // response which contains instance partitions, and systems are expected to
1440
+ // put that etag in the request to update instance partitions to ensure that
1441
+ // their change will be applied to the same version of the instance partition.
1442
+ // If no etag is provided in the call to update instance partition, then the
1443
+ // existing instance partition is overwritten blindly.
1444
+ string etag = 12;
1445
+ }
1446
+
1447
+ // Metadata type for the operation returned by
1448
+ // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition].
1449
+ message CreateInstancePartitionMetadata {
1450
+ // The instance partition being created.
1451
+ InstancePartition instance_partition = 1;
1452
+
1453
+ // The time at which the
1454
+ // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition]
1455
+ // request was received.
1456
+ google.protobuf.Timestamp start_time = 2;
1457
+
1458
+ // The time at which this operation was cancelled. If set, this operation is
1459
+ // in the process of undoing itself (which is guaranteed to succeed) and
1460
+ // cannot be cancelled again.
1461
+ google.protobuf.Timestamp cancel_time = 3;
1462
+
1463
+ // The time at which this operation failed or was completed successfully.
1464
+ google.protobuf.Timestamp end_time = 4;
1465
+ }
1466
+
1467
+ // The request for
1468
+ // [CreateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstancePartition].
1469
+ message CreateInstancePartitionRequest {
1470
+ // Required. The name of the instance in which to create the instance
1471
+ // partition. Values are of the form
1472
+ // `projects/<project>/instances/<instance>`.
1473
+ string parent = 1 [
1474
+ (google.api.field_behavior) = REQUIRED,
1475
+ (google.api.resource_reference) = {
1476
+ type: "spanner.googleapis.com/Instance"
1477
+ }
1478
+ ];
1479
+
1480
+ // Required. The ID of the instance partition to create. Valid identifiers are
1481
+ // of the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 2 and 64
1482
+ // characters in length.
1483
+ string instance_partition_id = 2 [(google.api.field_behavior) = REQUIRED];
1484
+
1485
+ // Required. The instance partition to create. The instance_partition.name may
1486
+ // be omitted, but if specified must be
1487
+ // `<parent>/instancePartitions/<instance_partition_id>`.
1488
+ InstancePartition instance_partition = 3
1489
+ [(google.api.field_behavior) = REQUIRED];
1490
+ }
1491
+
1492
+ // The request for
1493
+ // [DeleteInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstancePartition].
1494
+ message DeleteInstancePartitionRequest {
1495
+ // Required. The name of the instance partition to be deleted.
1496
+ // Values are of the form
1497
+ // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`
1498
+ string name = 1 [
1499
+ (google.api.field_behavior) = REQUIRED,
1500
+ (google.api.resource_reference) = {
1501
+ type: "spanner.googleapis.com/InstancePartition"
1502
+ }
1503
+ ];
1504
+
1505
+ // Optional. If not empty, the API only deletes the instance partition when
1506
+ // the etag provided matches the current status of the requested instance
1507
+ // partition. Otherwise, deletes the instance partition without checking the
1508
+ // current status of the requested instance partition.
1509
+ string etag = 2;
1510
+ }
1511
+
1512
+ // The request for
1513
+ // [GetInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.GetInstancePartition].
1514
+ message GetInstancePartitionRequest {
1515
+ // Required. The name of the requested instance partition. Values are of
1516
+ // the form
1517
+ // `projects/{project}/instances/{instance}/instancePartitions/{instance_partition}`.
1518
+ string name = 1 [
1519
+ (google.api.field_behavior) = REQUIRED,
1520
+ (google.api.resource_reference) = {
1521
+ type: "spanner.googleapis.com/InstancePartition"
1522
+ }
1523
+ ];
1524
+ }
1525
+
1526
+ // The request for
1527
+ // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition].
1528
+ message UpdateInstancePartitionRequest {
1529
+ // Required. The instance partition to update, which must always include the
1530
+ // instance partition name. Otherwise, only fields mentioned in
1531
+ // [field_mask][google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.field_mask]
1532
+ // need be included.
1533
+ InstancePartition instance_partition = 1
1534
+ [(google.api.field_behavior) = REQUIRED];
1535
+
1536
+ // Required. A mask specifying which fields in
1537
+ // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition]
1538
+ // should be updated. The field mask must always be specified; this prevents
1539
+ // any future fields in
1540
+ // [InstancePartition][google.spanner.admin.instance.v1.InstancePartition]
1541
+ // from being erased accidentally by clients that do not know about them.
1542
+ google.protobuf.FieldMask field_mask = 2
1543
+ [(google.api.field_behavior) = REQUIRED];
1544
+ }
1545
+
1546
+ // Metadata type for the operation returned by
1547
+ // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition].
1548
+ message UpdateInstancePartitionMetadata {
1549
+ // The desired end state of the update.
1550
+ InstancePartition instance_partition = 1;
1551
+
1552
+ // The time at which
1553
+ // [UpdateInstancePartition][google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstancePartition]
1554
+ // request was received.
1555
+ google.protobuf.Timestamp start_time = 2;
1556
+
1557
+ // The time at which this operation was cancelled. If set, this operation is
1558
+ // in the process of undoing itself (which is guaranteed to succeed) and
1559
+ // cannot be cancelled again.
1560
+ google.protobuf.Timestamp cancel_time = 3;
1561
+
1562
+ // The time at which this operation failed or was completed successfully.
1563
+ google.protobuf.Timestamp end_time = 4;
1564
+ }
1565
+
1566
+ // The request for
1567
+ // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions].
1568
+ message ListInstancePartitionsRequest {
1569
+ // Required. The instance whose instance partitions should be listed. Values
1570
+ // are of the form `projects/<project>/instances/<instance>`.
1571
+ string parent = 1 [
1572
+ (google.api.field_behavior) = REQUIRED,
1573
+ (google.api.resource_reference) = {
1574
+ type: "spanner.googleapis.com/Instance"
1575
+ }
1576
+ ];
1577
+
1578
+ // Number of instance partitions to be returned in the response. If 0 or less,
1579
+ // defaults to the server's maximum allowed page size.
1580
+ int32 page_size = 2;
1581
+
1582
+ // If non-empty, `page_token` should contain a
1583
+ // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.next_page_token]
1584
+ // from a previous
1585
+ // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse].
1586
+ string page_token = 3;
1587
+
1588
+ // Optional. Deadline used while retrieving metadata for instance partitions.
1589
+ // Instance partitions whose metadata cannot be retrieved within this deadline
1590
+ // will be added to
1591
+ // [unreachable][google.spanner.admin.instance.v1.ListInstancePartitionsResponse.unreachable]
1592
+ // in
1593
+ // [ListInstancePartitionsResponse][google.spanner.admin.instance.v1.ListInstancePartitionsResponse].
1594
+ google.protobuf.Timestamp instance_partition_deadline = 4
1595
+ [(google.api.field_behavior) = OPTIONAL];
1596
+ }
1597
+
1598
+ // The response for
1599
+ // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions].
1600
+ message ListInstancePartitionsResponse {
1601
+ // The list of requested instancePartitions.
1602
+ repeated InstancePartition instance_partitions = 1;
1603
+
1604
+ // `next_page_token` can be sent in a subsequent
1605
+ // [ListInstancePartitions][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitions]
1606
+ // call to fetch more of the matching instance partitions.
1607
+ string next_page_token = 2;
1608
+
1609
+ // The list of unreachable instance partitions.
1610
+ // It includes the names of instance partitions whose metadata could
1611
+ // not be retrieved within
1612
+ // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instance_partition_deadline].
1613
+ repeated string unreachable = 3;
1614
+ }
1615
+
1616
+ // The request for
1617
+ // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations].
1618
+ message ListInstancePartitionOperationsRequest {
1619
+ // Required. The parent instance of the instance partition operations.
1620
+ // Values are of the form `projects/<project>/instances/<instance>`.
1621
+ string parent = 1 [
1622
+ (google.api.field_behavior) = REQUIRED,
1623
+ (google.api.resource_reference) = {
1624
+ type: "spanner.googleapis.com/Instance"
1625
+ }
1626
+ ];
1627
+
1628
+ // Optional. An expression that filters the list of returned operations.
1629
+ //
1630
+ // A filter expression consists of a field name, a
1631
+ // comparison operator, and a value for filtering.
1632
+ // The value must be a string, a number, or a boolean. The comparison operator
1633
+ // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1634
+ // Colon `:` is the contains operator. Filter rules are not case sensitive.
1635
+ //
1636
+ // The following fields in the [Operation][google.longrunning.Operation]
1637
+ // are eligible for filtering:
1638
+ //
1639
+ // * `name` - The name of the long-running operation
1640
+ // * `done` - False if the operation is in progress, else true.
1641
+ // * `metadata.@type` - the type of metadata. For example, the type string
1642
+ // for
1643
+ // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]
1644
+ // is
1645
+ // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata`.
1646
+ // * `metadata.<field_name>` - any field in metadata.value.
1647
+ // `metadata.@type` must be specified first, if filtering on metadata
1648
+ // fields.
1649
+ // * `error` - Error associated with the long-running operation.
1650
+ // * `response.@type` - the type of response.
1651
+ // * `response.<field_name>` - any field in response.value.
1652
+ //
1653
+ // You can combine multiple expressions by enclosing each expression in
1654
+ // parentheses. By default, expressions are combined with AND logic. However,
1655
+ // you can specify AND, OR, and NOT logic explicitly.
1656
+ //
1657
+ // Here are a few examples:
1658
+ //
1659
+ // * `done:true` - The operation is complete.
1660
+ // * `(metadata.@type=` \
1661
+ // `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata)
1662
+ // AND` \
1663
+ // `(metadata.instance_partition.name:custom-instance-partition) AND` \
1664
+ // `(metadata.start_time < \"2021-03-28T14:50:00Z\") AND` \
1665
+ // `(error:*)` - Return operations where:
1666
+ // * The operation's metadata type is
1667
+ // [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata].
1668
+ // * The instance partition name contains "custom-instance-partition".
1669
+ // * The operation started before 2021-03-28T14:50:00Z.
1670
+ // * The operation resulted in an error.
1671
+ string filter = 2 [(google.api.field_behavior) = OPTIONAL];
1672
+
1673
+ // Optional. Number of operations to be returned in the response. If 0 or
1674
+ // less, defaults to the server's maximum allowed page size.
1675
+ int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
1676
+
1677
+ // Optional. If non-empty, `page_token` should contain a
1678
+ // [next_page_token][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.next_page_token]
1679
+ // from a previous
1680
+ // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse]
1681
+ // to the same `parent` and with the same `filter`.
1682
+ string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
1683
+
1684
+ // Optional. Deadline used while retrieving metadata for instance partition
1685
+ // operations. Instance partitions whose operation metadata cannot be
1686
+ // retrieved within this deadline will be added to
1687
+ // [unreachable][ListInstancePartitionOperationsResponse.unreachable] in
1688
+ // [ListInstancePartitionOperationsResponse][google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse].
1689
+ google.protobuf.Timestamp instance_partition_deadline = 5
1690
+ [(google.api.field_behavior) = OPTIONAL];
1691
+ }
1692
+
1693
+ // The response for
1694
+ // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations].
1695
+ message ListInstancePartitionOperationsResponse {
1696
+ // The list of matching instance partition [long-running
1697
+ // operations][google.longrunning.Operation]. Each operation's name will be
1698
+ // prefixed by the instance partition's name. The operation's
1699
+ // [metadata][google.longrunning.Operation.metadata] field type
1700
+ // `metadata.type_url` describes the type of the metadata.
1701
+ repeated google.longrunning.Operation operations = 1;
1702
+
1703
+ // `next_page_token` can be sent in a subsequent
1704
+ // [ListInstancePartitionOperations][google.spanner.admin.instance.v1.InstanceAdmin.ListInstancePartitionOperations]
1705
+ // call to fetch more of the matching metadata.
1706
+ string next_page_token = 2;
1707
+
1708
+ // The list of unreachable instance partitions.
1709
+ // It includes the names of instance partitions whose operation metadata could
1710
+ // not be retrieved within
1711
+ // [instance_partition_deadline][google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instance_partition_deadline].
1712
+ repeated string unreachable_instance_partitions = 3;
1713
+ }