@@ -21,14 +21,14 @@ async function runInstanceOperations(instanceID, clusterID) {
21
21
const bigtable = Bigtable ( ) ;
22
22
const instance = bigtable . instance ( instanceID ) ;
23
23
24
- console . log ( ` Check Instance Exists` ) ;
24
+ console . log ( ' Check Instance Exists' ) ;
25
25
// [START bigtable_check_instance_exists]
26
26
const [ instanceExists ] = await instance . exists ( ) ;
27
27
// [END bigtable_check_instance_exists]
28
28
29
29
// Create instance if does not exists
30
30
if ( ! instanceExists ) {
31
- console . log ( ` Creating a PRODUCTION Instance` ) ;
31
+ console . log ( ' Creating a PRODUCTION Instance' ) ;
32
32
// [START bigtable_create_prod_instance]
33
33
// Creates a Production Instance with the ID "ssd-instance"
34
34
// with cluster id "ssd-cluster", 3 nodes and location us-central1-f
@@ -55,7 +55,7 @@ async function runInstanceOperations(instanceID, clusterID) {
55
55
}
56
56
57
57
console . log ( ) ; //for just a new-line
58
- console . log ( ` Listing Instances:` ) ;
58
+ console . log ( ' Listing Instances:' ) ;
59
59
// [START bigtable_list_instances]
60
60
const [ instances ] = await bigtable . getInstances ( ) ;
61
61
instances . forEach ( instance => {
@@ -64,15 +64,15 @@ async function runInstanceOperations(instanceID, clusterID) {
64
64
// [END bigtable_list_instances]
65
65
66
66
console . log ( ) ; //for just a new-line
67
- console . log ( ` Get Instance` ) ;
67
+ console . log ( ' Get Instance' ) ;
68
68
// [START bigtable_get_instance]
69
69
const [ instances2 ] = await bigtable . instance ( instanceID ) . get ( ) ;
70
70
console . log ( `Instance ID: ${ instances2 . id } ` ) ;
71
71
console . log ( `Instance Meta: ${ JSON . stringify ( instances2 . metadata ) } ` ) ;
72
72
// [END bigtable_get_instance]
73
73
74
74
console . log ( ) ; //for just a new-line
75
- console . log ( ` Listing Clusters...` ) ;
75
+ console . log ( ' Listing Clusters...' ) ;
76
76
// [START bigtable_get_clusters]
77
77
const instance3 = bigtable . instance ( instanceID ) ;
78
78
const [ clusters ] = await instance3 . getClusters ( ) ;
@@ -90,7 +90,7 @@ async function createDevInstance(instanceID, clusterID) {
90
90
91
91
// [START bigtable_create_dev_instance]
92
92
console . log ( ) ; //for just a new-line
93
- console . log ( ` Creating a DEVELOPMENT Instance` ) ;
93
+ console . log ( ' Creating a DEVELOPMENT Instance' ) ;
94
94
// Set options to create an Instance
95
95
const options = {
96
96
clusters : [
@@ -118,7 +118,7 @@ async function deleteInstance(instanceID) {
118
118
119
119
console . log ( ) ; //for just a new-line
120
120
// [START bigtable_delete_instance]
121
- console . log ( ` Deleting Instance` ) ;
121
+ console . log ( ' Deleting Instance' ) ;
122
122
await instance . delete ( ) ;
123
123
console . log ( `Instance deleted: ${ instance . id } ` ) ;
124
124
// [END bigtable_delete_instance]
@@ -130,7 +130,7 @@ async function addCluster(instanceID, clusterID) {
130
130
const instance = bigtable . instance ( instanceID ) ;
131
131
const [ instanceExists ] = await instance . exists ( ) ;
132
132
if ( ! instanceExists ) {
133
- console . log ( ` Instance does not exists` ) ;
133
+ console . log ( ' Instance does not exists' ) ;
134
134
} else {
135
135
console . log ( ) ; //for just a new-line
136
136
console . log ( `Adding Cluster to Instance ${ instance . id } ` ) ;
@@ -155,58 +155,58 @@ async function deleteCluster(instanceID, clusterID) {
155
155
156
156
// [START bigtable_delete_cluster]
157
157
console . log ( ) ; //for just a new-line
158
- console . log ( ` Deleting Cluster` ) ;
158
+ console . log ( ' Deleting Cluster' ) ;
159
159
await cluster . delete ( ) ;
160
160
console . log ( `Cluster deleted: ${ cluster . id } ` ) ;
161
161
// [END bigtable_delete_cluster]
162
162
}
163
163
164
- require ( ` yargs` )
164
+ require ( ' yargs' )
165
165
. demand ( 1 )
166
166
. command (
167
- ` run` ,
168
- ` Creates an Instance(type: PRODUCTION) and run basic instance-operations` ,
167
+ ' run' ,
168
+ ' Creates an Instance(type: PRODUCTION) and run basic instance-operations' ,
169
169
{ } ,
170
170
argv => runInstanceOperations ( argv . instance , argv . cluster )
171
171
)
172
172
. example (
173
- ` node $0 run --instance [instanceID] --cluster [clusterID]` ,
174
- ` Run instance operations`
173
+ ' node $0 run --instance [instanceID] --cluster [clusterID]' ,
174
+ ' Run instance operations'
175
175
)
176
- . command ( ` dev-instance` , ` Create Development Instance` , { } , argv =>
176
+ . command ( ' dev-instance' , ' Create Development Instance' , { } , argv =>
177
177
createDevInstance ( argv . instance , argv . cluster )
178
178
)
179
179
. example (
180
- ` node $0 dev-instance --instance [instanceID]` ,
181
- ` Create Development Instance`
180
+ ' node $0 dev-instance --instance [instanceID]' ,
181
+ ' Create Development Instance'
182
182
)
183
- . command ( ` del-instance` , ` Delete the Instance` , { } , argv =>
183
+ . command ( ' del-instance' , ' Delete the Instance' , { } , argv =>
184
184
deleteInstance ( argv . instance )
185
185
)
186
186
. example (
187
- ` node $0 del-instance --instance [instanceID]` ,
188
- ` Delete the Instance.`
187
+ ' node $0 del-instance --instance [instanceID]' ,
188
+ ' Delete the Instance.'
189
189
)
190
- . command ( ` add-cluster` , ` Add Cluster` , { } , argv =>
190
+ . command ( ' add-cluster' , ' Add Cluster' , { } , argv =>
191
191
addCluster ( argv . instance , argv . cluster )
192
192
)
193
193
. example (
194
- ` node $0 add-cluster --instance [instanceID] --cluster [clusterID]` ,
195
- ` Add Cluster`
194
+ ' node $0 add-cluster --instance [instanceID] --cluster [clusterID]' ,
195
+ ' Add Cluster'
196
196
)
197
- . command ( ` del-cluster` , ` Delete the Cluster` , { } , argv =>
197
+ . command ( ' del-cluster' , ' Delete the Cluster' , { } , argv =>
198
198
deleteCluster ( argv . instance , argv . cluster )
199
199
)
200
200
. example (
201
- ` node $0 del-cluster --instance [instanceID] --cluster [clusterID]` ,
202
- ` Delete the Cluster`
201
+ ' node $0 del-cluster --instance [instanceID] --cluster [clusterID]' ,
202
+ ' Delete the Cluster'
203
203
)
204
204
. wrap ( 120 )
205
205
. nargs ( 'instance' , 1 )
206
206
. nargs ( 'cluster' , 1 )
207
207
. describe ( 'instance' , 'Cloud Bigtable Instance ID' )
208
208
. describe ( 'cluster' , 'Cloud Bigtable Cluster ID' )
209
209
. recommendCommands ( )
210
- . epilogue ( ` For more information, see https://cloud.google.com/bigtable/docs` )
210
+ . epilogue ( ' For more information, see https://cloud.google.com/bigtable/docs' )
211
211
. help ( )
212
212
. strict ( ) . argv ;
0 commit comments