@google-cloud/spanner 6.1.4 → 6.3.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 +29 -0
- package/README.md +4 -0
- package/build/protos/google/spanner/admin/instance/v1/common.proto +42 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +494 -41
- package/build/protos/google/spanner/v1/type.proto +8 -0
- package/build/protos/protos.d.ts +1091 -69
- package/build/protos/protos.js +3648 -1112
- package/build/protos/protos.json +312 -1
- package/build/src/index.d.ts +206 -0
- package/build/src/index.js +110 -1
- package/build/src/instance-config.d.ts +294 -0
- package/build/src/instance-config.js +216 -0
- package/build/src/v1/database_admin_client.d.ts +11 -4
- package/build/src/v1/database_admin_client.js +111 -74
- package/build/src/v1/gapic_metadata.json +44 -0
- package/build/src/v1/instance_admin_client.d.ts +514 -22
- package/build/src/v1/instance_admin_client.js +378 -44
- package/build/src/v1/instance_admin_client_config.json +16 -0
- package/build/src/v1/instance_admin_proto_list.json +1 -0
- package/build/src/v1/spanner_client.d.ts +10 -3
- package/build/src/v1/spanner_client.js +68 -43
- package/package.json +10 -10
package/build/protos/protos.json
CHANGED
|
@@ -2720,6 +2720,22 @@
|
|
|
2720
2720
|
"ruby_package": "Google::Cloud::Spanner::Admin::Instance::V1"
|
|
2721
2721
|
},
|
|
2722
2722
|
"nested": {
|
|
2723
|
+
"OperationProgress": {
|
|
2724
|
+
"fields": {
|
|
2725
|
+
"progressPercent": {
|
|
2726
|
+
"type": "int32",
|
|
2727
|
+
"id": 1
|
|
2728
|
+
},
|
|
2729
|
+
"startTime": {
|
|
2730
|
+
"type": "google.protobuf.Timestamp",
|
|
2731
|
+
"id": 2
|
|
2732
|
+
},
|
|
2733
|
+
"endTime": {
|
|
2734
|
+
"type": "google.protobuf.Timestamp",
|
|
2735
|
+
"id": 3
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
},
|
|
2723
2739
|
"InstanceAdmin": {
|
|
2724
2740
|
"options": {
|
|
2725
2741
|
"(google.api.default_host)": "spanner.googleapis.com",
|
|
@@ -2762,6 +2778,98 @@
|
|
|
2762
2778
|
}
|
|
2763
2779
|
]
|
|
2764
2780
|
},
|
|
2781
|
+
"CreateInstanceConfig": {
|
|
2782
|
+
"requestType": "CreateInstanceConfigRequest",
|
|
2783
|
+
"responseType": "google.longrunning.Operation",
|
|
2784
|
+
"options": {
|
|
2785
|
+
"(google.api.http).post": "/v1/{parent=projects/*}/instanceConfigs",
|
|
2786
|
+
"(google.api.http).body": "*",
|
|
2787
|
+
"(google.api.method_signature)": "parent,instance_config,instance_config_id",
|
|
2788
|
+
"(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig",
|
|
2789
|
+
"(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"
|
|
2790
|
+
},
|
|
2791
|
+
"parsedOptions": [
|
|
2792
|
+
{
|
|
2793
|
+
"(google.api.http)": {
|
|
2794
|
+
"post": "/v1/{parent=projects/*}/instanceConfigs",
|
|
2795
|
+
"body": "*"
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
"(google.api.method_signature)": "parent,instance_config,instance_config_id"
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
"(google.longrunning.operation_info)": {
|
|
2803
|
+
"response_type": "google.spanner.admin.instance.v1.InstanceConfig",
|
|
2804
|
+
"metadata_type": "google.spanner.admin.instance.v1.CreateInstanceConfigMetadata"
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
]
|
|
2808
|
+
},
|
|
2809
|
+
"UpdateInstanceConfig": {
|
|
2810
|
+
"requestType": "UpdateInstanceConfigRequest",
|
|
2811
|
+
"responseType": "google.longrunning.Operation",
|
|
2812
|
+
"options": {
|
|
2813
|
+
"(google.api.http).patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}",
|
|
2814
|
+
"(google.api.http).body": "*",
|
|
2815
|
+
"(google.api.method_signature)": "instance_config,update_mask",
|
|
2816
|
+
"(google.longrunning.operation_info).response_type": "google.spanner.admin.instance.v1.InstanceConfig",
|
|
2817
|
+
"(google.longrunning.operation_info).metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"
|
|
2818
|
+
},
|
|
2819
|
+
"parsedOptions": [
|
|
2820
|
+
{
|
|
2821
|
+
"(google.api.http)": {
|
|
2822
|
+
"patch": "/v1/{instance_config.name=projects/*/instanceConfigs/*}",
|
|
2823
|
+
"body": "*"
|
|
2824
|
+
}
|
|
2825
|
+
},
|
|
2826
|
+
{
|
|
2827
|
+
"(google.api.method_signature)": "instance_config,update_mask"
|
|
2828
|
+
},
|
|
2829
|
+
{
|
|
2830
|
+
"(google.longrunning.operation_info)": {
|
|
2831
|
+
"response_type": "google.spanner.admin.instance.v1.InstanceConfig",
|
|
2832
|
+
"metadata_type": "google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata"
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
]
|
|
2836
|
+
},
|
|
2837
|
+
"DeleteInstanceConfig": {
|
|
2838
|
+
"requestType": "DeleteInstanceConfigRequest",
|
|
2839
|
+
"responseType": "google.protobuf.Empty",
|
|
2840
|
+
"options": {
|
|
2841
|
+
"(google.api.http).delete": "/v1/{name=projects/*/instanceConfigs/*}",
|
|
2842
|
+
"(google.api.method_signature)": "name"
|
|
2843
|
+
},
|
|
2844
|
+
"parsedOptions": [
|
|
2845
|
+
{
|
|
2846
|
+
"(google.api.http)": {
|
|
2847
|
+
"delete": "/v1/{name=projects/*/instanceConfigs/*}"
|
|
2848
|
+
}
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
"(google.api.method_signature)": "name"
|
|
2852
|
+
}
|
|
2853
|
+
]
|
|
2854
|
+
},
|
|
2855
|
+
"ListInstanceConfigOperations": {
|
|
2856
|
+
"requestType": "ListInstanceConfigOperationsRequest",
|
|
2857
|
+
"responseType": "ListInstanceConfigOperationsResponse",
|
|
2858
|
+
"options": {
|
|
2859
|
+
"(google.api.http).get": "/v1/{parent=projects/*}/instanceConfigOperations",
|
|
2860
|
+
"(google.api.method_signature)": "parent"
|
|
2861
|
+
},
|
|
2862
|
+
"parsedOptions": [
|
|
2863
|
+
{
|
|
2864
|
+
"(google.api.http)": {
|
|
2865
|
+
"get": "/v1/{parent=projects/*}/instanceConfigOperations"
|
|
2866
|
+
}
|
|
2867
|
+
},
|
|
2868
|
+
{
|
|
2869
|
+
"(google.api.method_signature)": "parent"
|
|
2870
|
+
}
|
|
2871
|
+
]
|
|
2872
|
+
},
|
|
2765
2873
|
"ListInstances": {
|
|
2766
2874
|
"requestType": "ListInstancesRequest",
|
|
2767
2875
|
"responseType": "ListInstancesResponse",
|
|
@@ -2974,15 +3082,76 @@
|
|
|
2974
3082
|
"type": "string",
|
|
2975
3083
|
"id": 2
|
|
2976
3084
|
},
|
|
3085
|
+
"configType": {
|
|
3086
|
+
"type": "Type",
|
|
3087
|
+
"id": 5,
|
|
3088
|
+
"options": {
|
|
3089
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
3090
|
+
}
|
|
3091
|
+
},
|
|
2977
3092
|
"replicas": {
|
|
2978
3093
|
"rule": "repeated",
|
|
2979
3094
|
"type": "ReplicaInfo",
|
|
2980
3095
|
"id": 3
|
|
2981
3096
|
},
|
|
3097
|
+
"optionalReplicas": {
|
|
3098
|
+
"rule": "repeated",
|
|
3099
|
+
"type": "ReplicaInfo",
|
|
3100
|
+
"id": 6,
|
|
3101
|
+
"options": {
|
|
3102
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
"baseConfig": {
|
|
3106
|
+
"type": "string",
|
|
3107
|
+
"id": 7,
|
|
3108
|
+
"options": {
|
|
3109
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig"
|
|
3110
|
+
}
|
|
3111
|
+
},
|
|
3112
|
+
"labels": {
|
|
3113
|
+
"keyType": "string",
|
|
3114
|
+
"type": "string",
|
|
3115
|
+
"id": 8
|
|
3116
|
+
},
|
|
3117
|
+
"etag": {
|
|
3118
|
+
"type": "string",
|
|
3119
|
+
"id": 9
|
|
3120
|
+
},
|
|
2982
3121
|
"leaderOptions": {
|
|
2983
3122
|
"rule": "repeated",
|
|
2984
3123
|
"type": "string",
|
|
2985
3124
|
"id": 4
|
|
3125
|
+
},
|
|
3126
|
+
"reconciling": {
|
|
3127
|
+
"type": "bool",
|
|
3128
|
+
"id": 10,
|
|
3129
|
+
"options": {
|
|
3130
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
3131
|
+
}
|
|
3132
|
+
},
|
|
3133
|
+
"state": {
|
|
3134
|
+
"type": "State",
|
|
3135
|
+
"id": 11,
|
|
3136
|
+
"options": {
|
|
3137
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
"nested": {
|
|
3142
|
+
"Type": {
|
|
3143
|
+
"values": {
|
|
3144
|
+
"TYPE_UNSPECIFIED": 0,
|
|
3145
|
+
"GOOGLE_MANAGED": 1,
|
|
3146
|
+
"USER_MANAGED": 2
|
|
3147
|
+
}
|
|
3148
|
+
},
|
|
3149
|
+
"State": {
|
|
3150
|
+
"values": {
|
|
3151
|
+
"STATE_UNSPECIFIED": 0,
|
|
3152
|
+
"CREATING": 1,
|
|
3153
|
+
"READY": 2
|
|
3154
|
+
}
|
|
2986
3155
|
}
|
|
2987
3156
|
}
|
|
2988
3157
|
},
|
|
@@ -3109,6 +3278,115 @@
|
|
|
3109
3278
|
}
|
|
3110
3279
|
}
|
|
3111
3280
|
},
|
|
3281
|
+
"CreateInstanceConfigRequest": {
|
|
3282
|
+
"fields": {
|
|
3283
|
+
"parent": {
|
|
3284
|
+
"type": "string",
|
|
3285
|
+
"id": 1,
|
|
3286
|
+
"options": {
|
|
3287
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
3288
|
+
"(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project"
|
|
3289
|
+
}
|
|
3290
|
+
},
|
|
3291
|
+
"instanceConfigId": {
|
|
3292
|
+
"type": "string",
|
|
3293
|
+
"id": 2,
|
|
3294
|
+
"options": {
|
|
3295
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
3296
|
+
}
|
|
3297
|
+
},
|
|
3298
|
+
"instanceConfig": {
|
|
3299
|
+
"type": "InstanceConfig",
|
|
3300
|
+
"id": 3,
|
|
3301
|
+
"options": {
|
|
3302
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
"validateOnly": {
|
|
3306
|
+
"type": "bool",
|
|
3307
|
+
"id": 4
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3311
|
+
"UpdateInstanceConfigRequest": {
|
|
3312
|
+
"fields": {
|
|
3313
|
+
"instanceConfig": {
|
|
3314
|
+
"type": "InstanceConfig",
|
|
3315
|
+
"id": 1,
|
|
3316
|
+
"options": {
|
|
3317
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
3318
|
+
}
|
|
3319
|
+
},
|
|
3320
|
+
"updateMask": {
|
|
3321
|
+
"type": "google.protobuf.FieldMask",
|
|
3322
|
+
"id": 2,
|
|
3323
|
+
"options": {
|
|
3324
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
3325
|
+
}
|
|
3326
|
+
},
|
|
3327
|
+
"validateOnly": {
|
|
3328
|
+
"type": "bool",
|
|
3329
|
+
"id": 3
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
},
|
|
3333
|
+
"DeleteInstanceConfigRequest": {
|
|
3334
|
+
"fields": {
|
|
3335
|
+
"name": {
|
|
3336
|
+
"type": "string",
|
|
3337
|
+
"id": 1,
|
|
3338
|
+
"options": {
|
|
3339
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
3340
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/InstanceConfig"
|
|
3341
|
+
}
|
|
3342
|
+
},
|
|
3343
|
+
"etag": {
|
|
3344
|
+
"type": "string",
|
|
3345
|
+
"id": 2
|
|
3346
|
+
},
|
|
3347
|
+
"validateOnly": {
|
|
3348
|
+
"type": "bool",
|
|
3349
|
+
"id": 3
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
},
|
|
3353
|
+
"ListInstanceConfigOperationsRequest": {
|
|
3354
|
+
"fields": {
|
|
3355
|
+
"parent": {
|
|
3356
|
+
"type": "string",
|
|
3357
|
+
"id": 1,
|
|
3358
|
+
"options": {
|
|
3359
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
3360
|
+
"(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project"
|
|
3361
|
+
}
|
|
3362
|
+
},
|
|
3363
|
+
"filter": {
|
|
3364
|
+
"type": "string",
|
|
3365
|
+
"id": 2
|
|
3366
|
+
},
|
|
3367
|
+
"pageSize": {
|
|
3368
|
+
"type": "int32",
|
|
3369
|
+
"id": 3
|
|
3370
|
+
},
|
|
3371
|
+
"pageToken": {
|
|
3372
|
+
"type": "string",
|
|
3373
|
+
"id": 4
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
},
|
|
3377
|
+
"ListInstanceConfigOperationsResponse": {
|
|
3378
|
+
"fields": {
|
|
3379
|
+
"operations": {
|
|
3380
|
+
"rule": "repeated",
|
|
3381
|
+
"type": "google.longrunning.Operation",
|
|
3382
|
+
"id": 1
|
|
3383
|
+
},
|
|
3384
|
+
"nextPageToken": {
|
|
3385
|
+
"type": "string",
|
|
3386
|
+
"id": 2
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3112
3390
|
"GetInstanceRequest": {
|
|
3113
3391
|
"fields": {
|
|
3114
3392
|
"name": {
|
|
@@ -3257,6 +3535,38 @@
|
|
|
3257
3535
|
"id": 4
|
|
3258
3536
|
}
|
|
3259
3537
|
}
|
|
3538
|
+
},
|
|
3539
|
+
"CreateInstanceConfigMetadata": {
|
|
3540
|
+
"fields": {
|
|
3541
|
+
"instanceConfig": {
|
|
3542
|
+
"type": "InstanceConfig",
|
|
3543
|
+
"id": 1
|
|
3544
|
+
},
|
|
3545
|
+
"progress": {
|
|
3546
|
+
"type": "OperationProgress",
|
|
3547
|
+
"id": 2
|
|
3548
|
+
},
|
|
3549
|
+
"cancelTime": {
|
|
3550
|
+
"type": "google.protobuf.Timestamp",
|
|
3551
|
+
"id": 3
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
},
|
|
3555
|
+
"UpdateInstanceConfigMetadata": {
|
|
3556
|
+
"fields": {
|
|
3557
|
+
"instanceConfig": {
|
|
3558
|
+
"type": "InstanceConfig",
|
|
3559
|
+
"id": 1
|
|
3560
|
+
},
|
|
3561
|
+
"progress": {
|
|
3562
|
+
"type": "OperationProgress",
|
|
3563
|
+
"id": 2
|
|
3564
|
+
},
|
|
3565
|
+
"cancelTime": {
|
|
3566
|
+
"type": "google.protobuf.Timestamp",
|
|
3567
|
+
"id": 3
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3260
3570
|
}
|
|
3261
3571
|
}
|
|
3262
3572
|
}
|
|
@@ -3764,7 +4074,8 @@
|
|
|
3764
4074
|
"TypeAnnotationCode": {
|
|
3765
4075
|
"values": {
|
|
3766
4076
|
"TYPE_ANNOTATION_CODE_UNSPECIFIED": 0,
|
|
3767
|
-
"PG_NUMERIC": 2
|
|
4077
|
+
"PG_NUMERIC": 2,
|
|
4078
|
+
"PG_JSONB": 3
|
|
3768
4079
|
}
|
|
3769
4080
|
},
|
|
3770
4081
|
"Spanner": {
|
package/build/src/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { Float, Int, Numeric, PGNumeric, Struct } from './codec';
|
|
|
22
22
|
import { Backup } from './backup';
|
|
23
23
|
import { Database } from './database';
|
|
24
24
|
import { Instance, CreateInstanceCallback, CreateInstanceResponse } from './instance';
|
|
25
|
+
import { InstanceConfig, CreateInstanceConfigCallback, CreateInstanceConfigResponse } from './instance-config';
|
|
25
26
|
import { grpc, GrpcClientOptions, CallOptions } from 'google-gax';
|
|
26
27
|
import { google, google as instanceAdmin } from '../protos/protos';
|
|
27
28
|
import { PagedOptions, PagedResponse, PagedCallback, PagedOptionsWithFilter, NormalCallback } from './common';
|
|
@@ -42,6 +43,9 @@ export interface GetInstanceConfigOptions {
|
|
|
42
43
|
}
|
|
43
44
|
export declare type GetInstanceConfigResponse = [IInstanceConfig];
|
|
44
45
|
export declare type GetInstanceConfigCallback = NormalCallback<IInstanceConfig>;
|
|
46
|
+
export declare type GetInstanceConfigOperationsOptions = PagedOptionsWithFilter;
|
|
47
|
+
export declare type GetInstanceConfigOperationsResponse = PagedResponse<IOperation, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse>;
|
|
48
|
+
export declare type GetInstanceConfigOperationsCallback = PagedCallback<IOperation, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse>;
|
|
45
49
|
export interface SpannerOptions extends GrpcClientOptions {
|
|
46
50
|
apiEndpoint?: string;
|
|
47
51
|
servicePath?: string;
|
|
@@ -67,6 +71,17 @@ export interface CreateInstanceRequest {
|
|
|
67
71
|
} | null;
|
|
68
72
|
gaxOptions?: CallOptions;
|
|
69
73
|
}
|
|
74
|
+
export interface CreateInstanceConfigRequest {
|
|
75
|
+
displayName?: string;
|
|
76
|
+
replicas?: google.spanner.admin.instance.v1.IReplicaInfo[];
|
|
77
|
+
baseConfig?: string;
|
|
78
|
+
labels?: {
|
|
79
|
+
[k: string]: string;
|
|
80
|
+
} | null;
|
|
81
|
+
etag?: string;
|
|
82
|
+
validateOnly?: boolean;
|
|
83
|
+
gaxOptions?: CallOptions;
|
|
84
|
+
}
|
|
70
85
|
/**
|
|
71
86
|
* Translates enum values to string keys.
|
|
72
87
|
*
|
|
@@ -133,6 +148,7 @@ declare class Spanner extends GrpcService {
|
|
|
133
148
|
auth: GoogleAuth;
|
|
134
149
|
clients_: Map<string, {}>;
|
|
135
150
|
instances_: Map<string, Instance>;
|
|
151
|
+
instanceConfigs_: Map<string, InstanceConfig>;
|
|
136
152
|
projectIdReplaced_: boolean;
|
|
137
153
|
projectFormattedName_: string;
|
|
138
154
|
resourceHeader_: {
|
|
@@ -374,6 +390,106 @@ declare class Spanner extends GrpcService {
|
|
|
374
390
|
* ```
|
|
375
391
|
*/
|
|
376
392
|
getInstancesStream(options?: GetInstancesOptions): NodeJS.ReadableStream;
|
|
393
|
+
/**
|
|
394
|
+
* Config for the new instance config.
|
|
395
|
+
*
|
|
396
|
+
* @typedef {object} CreateInstanceConfigRequest
|
|
397
|
+
* @property {string} [displayName] The name of this instance configuration as
|
|
398
|
+
* it appears in the user interface.
|
|
399
|
+
* @property {google.spanner.admin.instance.v1.IReplicaInfo[]} [replicas] The
|
|
400
|
+
* geographic placement of nodes in this instance configuration and their
|
|
401
|
+
* replication properties.
|
|
402
|
+
* @property {string} [baseConfig] Base configuration name,
|
|
403
|
+
* e.g. projects/<project_name>/instanceConfigs/nam3 based on which this
|
|
404
|
+
* configuration is created.
|
|
405
|
+
* @property {Object.<string, string>} [labels] Cloud Labels are a flexible
|
|
406
|
+
* and lightweight mechanism for organizing cloud resources into groups
|
|
407
|
+
* that reflect a customer's organizational needs and deployment
|
|
408
|
+
* strategies. Cloud Labels can be used to filter collections of
|
|
409
|
+
* resources. They can be used to control how resource metrics are
|
|
410
|
+
* aggregated. And they can be used as arguments to policy management
|
|
411
|
+
* rules (e.g. route, firewall, load balancing, etc.).
|
|
412
|
+
* @property {string} [etag] etag is used for optimistic concurrency control
|
|
413
|
+
* as a way to help prevent simultaneous updates of a instance config from
|
|
414
|
+
* overwriting each other.
|
|
415
|
+
* @property {boolean} [validateOnly] An option to validate, but not actually
|
|
416
|
+
* execute, a request, and provide the same response.
|
|
417
|
+
*/
|
|
418
|
+
/**
|
|
419
|
+
* @typedef {array} CreateInstanceConfigResponse
|
|
420
|
+
* @property {InstanceConfig} 0 The new {@link google.spanner.admin.instance.v1.InstanceConfig}.
|
|
421
|
+
* @property {google.longrunning.Operation} 1 An operation object that can be
|
|
422
|
+
* used to check the status of the request.
|
|
423
|
+
* @property {google.longrunning.IOperation} 2 The full API response.
|
|
424
|
+
*/
|
|
425
|
+
/**
|
|
426
|
+
* @callback CreateInstanceConfigCallback
|
|
427
|
+
* @param {?Error} err Request error, if any.
|
|
428
|
+
* @param {InstanceConfig} instanceConfig The new {@link google.spanner.admin.instance.v1.InstanceConfig}.
|
|
429
|
+
* @param {google.longrunning.Operation} operation An operation object that
|
|
430
|
+
* can be used to check the status of the request.
|
|
431
|
+
* @param {google.longrunning.IOperation} apiResponse The full API response.
|
|
432
|
+
*/
|
|
433
|
+
/**
|
|
434
|
+
* Create an instance config.
|
|
435
|
+
*
|
|
436
|
+
* Wrapper around {@link v1.InstanceAdminClient#createInstanceConfig}.
|
|
437
|
+
*
|
|
438
|
+
* @see {@link v1.InstanceAdminClient#createInstanceConfig}
|
|
439
|
+
* @see [CreateInstanceConfig API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig)
|
|
440
|
+
*
|
|
441
|
+
* @throws {GoogleError} If a name is not provided.
|
|
442
|
+
* @throws {GoogleError} If a configuration object is not provided.
|
|
443
|
+
* @throws {GoogleError} If a base config is not provided in the configuration
|
|
444
|
+
* object.
|
|
445
|
+
*
|
|
446
|
+
* @param {string} name The name of the instance config to be created.
|
|
447
|
+
* @param {CreateInstanceConfigRequest} config Configuration object.
|
|
448
|
+
* @param {CreateInstanceConfigCallback} [callback] Callback function.
|
|
449
|
+
* @returns {Promise<CreateInstanceConfigResponse>}
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```
|
|
453
|
+
* const {Spanner} = require('@google-cloud/spanner');
|
|
454
|
+
* const spanner = new Spanner();
|
|
455
|
+
*
|
|
456
|
+
* const [baseInstanceConfig] =
|
|
457
|
+
* await spanner.getInstanceConfig(baseInstanceConfigId);
|
|
458
|
+
* const config = {
|
|
459
|
+
* baseConfig: baseInstanceConfig.name,
|
|
460
|
+
* replicas: baseInstanceConfig.replicas.concat(baseInstanceConfig.optionalReplicas[0])
|
|
461
|
+
* };
|
|
462
|
+
*
|
|
463
|
+
* function callback(err, instance, operation, apiResponse) {
|
|
464
|
+
* if (err) {
|
|
465
|
+
* // Error handling omitted.
|
|
466
|
+
* }
|
|
467
|
+
*
|
|
468
|
+
* operation
|
|
469
|
+
* .on('error', function(err) {})
|
|
470
|
+
* .on('complete', function() {
|
|
471
|
+
* // Instance created successfully.
|
|
472
|
+
* });
|
|
473
|
+
* }
|
|
474
|
+
*
|
|
475
|
+
* spanner.createInstanceConfig('custom-new-instance-config', config, callback);
|
|
476
|
+
*
|
|
477
|
+
* //-
|
|
478
|
+
* // If the callback is omitted, we'll return a Promise.
|
|
479
|
+
* //-
|
|
480
|
+
* spanner.createInstanceConfig('custom-new-instance-config', config)
|
|
481
|
+
* .then(function(data) {
|
|
482
|
+
* const instanceConfig = data[0];
|
|
483
|
+
* const operation = data[1];
|
|
484
|
+
* return operation.promise();
|
|
485
|
+
* })
|
|
486
|
+
* .then(function() {
|
|
487
|
+
* // Instance config created successfully.
|
|
488
|
+
* });
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
createInstanceConfig(name: string, config: CreateInstanceConfigRequest): Promise<CreateInstanceConfigResponse>;
|
|
492
|
+
createInstanceConfig(name: string, config: CreateInstanceConfigRequest, callback: CreateInstanceConfigCallback): void;
|
|
377
493
|
/**
|
|
378
494
|
* Lists the supported instance configurations for a given project.
|
|
379
495
|
*
|
|
@@ -555,6 +671,72 @@ declare class Spanner extends GrpcService {
|
|
|
555
671
|
getInstanceConfig(name: string, options: GetInstanceConfigOptions): Promise<GetInstanceConfigResponse>;
|
|
556
672
|
getInstanceConfig(name: string, callback: GetInstanceConfigCallback): void;
|
|
557
673
|
getInstanceConfig(name: string, options: GetInstanceConfigOptions, callback: GetInstanceConfigCallback): void;
|
|
674
|
+
/**
|
|
675
|
+
* Query object for listing instance config operations.
|
|
676
|
+
*
|
|
677
|
+
* @typedef {object} GetInstanceConfigOperationsOptions
|
|
678
|
+
* @property {string} [filter] An expression for filtering the results of the
|
|
679
|
+
* request. Filter can be configured as outlined in
|
|
680
|
+
* {@link v1.DatabaseAdminClient#listInstanceConfigOperations}.
|
|
681
|
+
* @property {number} [pageSize] Maximum number of results per page.
|
|
682
|
+
* @property {string} [pageToken] A previously-returned page token
|
|
683
|
+
* representing part of the larger set of results to view.
|
|
684
|
+
* @property {object} [gaxOptions] Request configuration options,
|
|
685
|
+
* See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
|
|
686
|
+
* for more details.
|
|
687
|
+
*/
|
|
688
|
+
/**
|
|
689
|
+
* @typedef {array} GetInstanceConfigOperationsResponse
|
|
690
|
+
* @property {google.longrunning.IOperation[]} 0 Array of {@link IOperation} instances.
|
|
691
|
+
* @property {object} 1 A query object to receive more results.
|
|
692
|
+
* @property {object} 2 The full API response.
|
|
693
|
+
*/
|
|
694
|
+
/**
|
|
695
|
+
* @callback GetInstanceConfigOperationsCallback
|
|
696
|
+
* @param {?Error} err Request error, if any.
|
|
697
|
+
* @param {google.longrunning.IOperation[]} 0 Array of {@link IOperation} instances.
|
|
698
|
+
* @param {object} nextQuery A query object to receive more results.
|
|
699
|
+
* @param {object} apiResponse The full API response.
|
|
700
|
+
*/
|
|
701
|
+
/**
|
|
702
|
+
* List pending and completed instance config operations.
|
|
703
|
+
*
|
|
704
|
+
* @see {@link #listOperations}
|
|
705
|
+
*
|
|
706
|
+
* @param {GetInstanceConfigOperationsOptions} [options] The query object for
|
|
707
|
+
* listing InstanceConfig operations.
|
|
708
|
+
* @param {gax.CallOptions} [options.gaxOptions] The request configuration
|
|
709
|
+
* options, See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
|
|
710
|
+
* for more details.
|
|
711
|
+
* @returns {Promise<GetInstanceConfigOperationsResponse>} When resolved,
|
|
712
|
+
* contains a paged list of InstanceConfig operations.
|
|
713
|
+
*
|
|
714
|
+
* @example
|
|
715
|
+
* ```
|
|
716
|
+
* const {Spanner} = require('@google-cloud/spanner');
|
|
717
|
+
* const spanner = new Spanner();
|
|
718
|
+
* const [operations] = await spanner.getInstanceConfigOperations();
|
|
719
|
+
*
|
|
720
|
+
* //-
|
|
721
|
+
* // To manually handle pagination, set autoPaginate:false in gaxOptions.
|
|
722
|
+
* //-
|
|
723
|
+
* let pageToken = undefined;
|
|
724
|
+
* do {
|
|
725
|
+
* const [operations, , response] = await spanner.getInstanceConfigOperations({
|
|
726
|
+
* pageSize: 3,
|
|
727
|
+
* pageToken,
|
|
728
|
+
* gaxOptions: {autoPaginate: false},
|
|
729
|
+
* });
|
|
730
|
+
* operations.forEach(operation => {
|
|
731
|
+
* // Do something with operation
|
|
732
|
+
* });
|
|
733
|
+
* pageToken = response.nextPageToken;
|
|
734
|
+
* } while (pageToken);
|
|
735
|
+
* ```
|
|
736
|
+
*/
|
|
737
|
+
getInstanceConfigOperations(options?: GetInstanceConfigOperationsOptions): Promise<GetInstanceConfigOperationsResponse>;
|
|
738
|
+
getInstanceConfigOperations(callback: GetInstanceConfigOperationsCallback): void;
|
|
739
|
+
getInstanceConfigOperations(options: GetInstanceConfigOperationsOptions, callback: GetInstanceConfigOperationsCallback): void;
|
|
558
740
|
/**
|
|
559
741
|
* Get a reference to an Instance object.
|
|
560
742
|
*
|
|
@@ -571,6 +753,22 @@ declare class Spanner extends GrpcService {
|
|
|
571
753
|
* ```
|
|
572
754
|
*/
|
|
573
755
|
instance(name: string): Instance;
|
|
756
|
+
/**
|
|
757
|
+
* Get a reference to an InstanceConfig object.
|
|
758
|
+
*
|
|
759
|
+
* @throws {GoogleError} If a name is not provided.
|
|
760
|
+
*
|
|
761
|
+
* @param {string} name The name of the instance config.
|
|
762
|
+
* @returns {InstanceConfig} An InstanceConfig object.
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* ```
|
|
766
|
+
* const {Spanner} = require('@google-cloud/spanner');
|
|
767
|
+
* const spanner = new Spanner();
|
|
768
|
+
* const instanceConfig = spanner.instanceConfig('my-instance-config');
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
instanceConfig(name: string): InstanceConfig;
|
|
574
772
|
/**
|
|
575
773
|
* Prepare a gapic request. This will cache the GAX client and replace
|
|
576
774
|
* {{projectId}} placeholders, if necessary.
|
|
@@ -766,6 +964,14 @@ export { Spanner };
|
|
|
766
964
|
* @type {Constructor}
|
|
767
965
|
*/
|
|
768
966
|
export { Instance };
|
|
967
|
+
/**
|
|
968
|
+
* {@link InstanceConfig} class.
|
|
969
|
+
*
|
|
970
|
+
* @name Spanner.InstanceConfig
|
|
971
|
+
* @see InstanceConfig
|
|
972
|
+
* @type {Constructor}
|
|
973
|
+
*/
|
|
974
|
+
export { InstanceConfig };
|
|
769
975
|
/**
|
|
770
976
|
* {@link Database} class.
|
|
771
977
|
*
|