require(`yargs`) .demand(1) .command( `readOnly <instanceName> <databaseName>`, `Execute a read-only transaction on an example Cloud Spanner table.`, {}, (opts) => readOnlyTransaction(opts.instanceName, opts.databaseName) ) .command( `readWrite <instanceName> <databaseName>`, `Execute a read-write transaction on an example Cloud Spanner table.`, {}, (opts) => readWriteTransaction(opts.instanceName, opts.databaseName) ) .example(`node $0 readOnly "my-instance" "my-database"`) .example(`node $0 readWrite "my-instance" "my-database"`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/spanner/docs`)
// [END storage_delete_bucket] require(`yargs`) .demand(1) .command( `create <bucket>`, `Creates a new bucket.`, {}, (opts) => createBucket(opts.bucket) ) .command( `list`, `Lists all buckets in the current project.`, {}, listBuckets ) .command( `delete <bucket>`, `Deletes a bucket.`, {}, (opts) => deleteBucket(opts.bucket) ) .example(`node $0 create my-bucket`, `Creates a new bucket named "my-bucket".`) .example(`node $0 list`, `Lists all buckets in the current project.`) .example(`node $0 delete my-bucket`, `Deletes a bucket named "my-bucket".`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/storage/docs`) .help() .strict()
cli .demand(1) .command('create <sinkName> <bucketName> [filter]', 'Creates a new sink with the given name to the specified bucket with an optional filter.', {}, function (options) { program.createSink(options.sinkName, options.bucketName, options.filter, utils.makeHandler(false)); }) .command('get <sinkName>', 'Gets the metadata for the specified sink.', {}, function (options) { program.getSinkMetadata(options.sinkName, utils.makeHandler()); }) .command('list', 'Lists all sinks.', {}, function () { program.listSinks(utils.makeHandler(true, 'id')); }) .command('update <sinkName> <filter>', 'Updates the filter for the specified sink.', {}, function (options) { program.updateSink(options.sinkName, options.filter, utils.makeHandler(false)); }) .command('delete <sinkName>', 'Deletes the specified sink.', {}, function (options) { program.deleteSink(options.sinkName, utils.makeHandler(false)); }) .example('node $0 create export-errors app-error-logs', 'Create a new sink named "export-errors" that exports logs to a bucket named "app-error-logs".') .example('node $0 get export-errors', 'Get the metadata for a sink name "export-errors".') .example('node $0 list', 'List all sinks.') .example('node $0 update export-errors "severity >= WARNING"', 'Update the filter for a sink named "export-errors".') .example('node $0 delete export-errors', 'Delete a sink named "export-errors".') .wrap(120) .recommendCommands() .epilogue('For more information, see https://cloud.google.com/logging/docs');
.example(`node $0 categories`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/dlp/docs`);
require(`yargs`) .demand(1) .command( `createDatabase <instanceName> <databaseName>`, `Creates an example database with two tables in a Cloud Spanner instance.`, {}, (opts) => createDatabase(opts.instanceName, opts.databaseName) ) .command( `addColumn <instanceName> <databaseName>`, `Adds an example MarketingBudget column to an example Cloud Spanner table.`, {}, (opts) => addColumn(opts.instanceName, opts.databaseName) ) .command( `queryNewColumn <instanceName> <databaseName>`, `Executes a read-only SQL query against an example Cloud Spanner table with an additional column (MarketingBudget) added by addColumn.`, {}, (opts) => queryDataWithNewColumn(opts.instanceName, opts.databaseName) ) .example(`node $0 createDatabase "my-instance" "my-database"`) .example(`node $0 addColumn "my-instance" "my-database"`) .example(`node $0 queryNewColumn "my-instance" "my-database"`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/spanner/docs`)
.example(`node $0 rotate my-bucket file_encrypted.txt QxhqaZEqBGVTW55HhQw9Q= SxafpsdfSDFS89sds9Q=`, `Rotates encryption keys for "gs://my-bucket/file_encrypted.txt".`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/storage/docs`) .help()
.example(`node $0 fpe "My SSN is 372819127" <YOUR_ENCRYPTED_AES_256_KEY> <YOUR_KEY_NAME>`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/dlp/docs.`)
.example('node $0 delete my-log', 'Delete "my-log".') .wrap(120) .recommendCommands() .epilogue('For more information, see https://cloud.google.com/logging/docs');
require(`yargs`) // eslint-disable-line .demand(1) .command( `create <project> <location> <queue>`, `Create a task.`, {}, (opts) => createTask(opts.project, opts.location, opts.queue) ) .command( `pull <project> <location> <queue>`, `Pull a task.`, {}, (opts) => pullTask(opts.project, opts.location, opts.queue) ) .command( `acknowledge <task>`, `Acknowledge a task.`, {}, (opts) => acknowledgeTask(JSON.parse(opts.task)) ) .example(`node $0 create my-project-id us-central1 my-queue`) .example(`node $0 pull my-project-id us-central1 my-queue`) .example(`node $0 acknowledge '{"name":"projects/my-project-id/locations/us-central1/queues/my-queue/tasks/1234","scheduleTime":"2017-11-01T22:27:53.628279Z"}'`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/cloud-tasks/docs`) .help() .strict()
cli .demand(1) .command(`create <datasetId>`, `Creates a new dataset.`, {}, (opts) => { program.createDataset(opts.datasetId); }) .command(`delete <datasetId>`, `Deletes a dataset.`, {}, (opts) => { program.deleteDataset(opts.datasetId); }) .command(`list [projectId]`, `Lists all datasets in the specified project or the current project.`, {}, (opts) => { program.listDatasets(opts.projectId || process.env.GCLOUD_PROJECT); }) .command(`size <datasetId> [projectId]`, `Calculates the size of a dataset.`, {}, (opts) => { program.getDatasetSize(opts.datasetId, opts.projectId || process.env.GCLOUD_PROJECT); }) .example(`node $0 create my_dataset`, `Creates a new dataset named "my_dataset".`) .example(`node $0 delete my_dataset`, `Deletes a dataset named "my_dataset".`) .example(`node $0 list`, `Lists all datasets in the current project.`) .example(`node $0 list bigquery-public-data`, `Lists all datasets in the "bigquery-public-data" project.`) .example(`node $0 size my_dataset`, `Calculates the size of "my_dataset" in the current project.`) .example(`node $0 size hacker_news bigquery-public-data`, `Calculates the size of "bigquery-public-data:hacker_news".`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/bigquery/docs`);
.recommendCommands() .epilogue(`For more information, see https://cloud.google.com/bigquery/docs`);
.example(`node $0 read "my-instance" "my-database"`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/spanner/docs`)
.example(`node $0 delete 12345`, `Deletes task 12345.`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/datastore/docs`) .help()
.example(`node $0 readStoringIndex "my-instance" "my-database"`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/spanner/docs`)
require(`yargs`) // eslint-disable-line .demand(1) .command( `create <project> <location> <queue>`, `Create a task.`, {}, (opts) => createTask(opts.project, opts.location, opts.queue) ) .command( `pull <project> <location> <queue>`, `Pull a task.`, {}, (opts) => pullTask(opts.project, opts.location, opts.queue) ) .command( `acknowledge <task>`, `Acknowledge a task.`, {}, (opts) => acknowledgeTask(JSON.parse(opts.task)) ) .example(`node $0 create my-project-id us-central1 my-queue`) .example(`node $0 pull my-project-id us-central1 my-queue`) .example(`node $0 acknowledge '{"name":"projects/my-project-id/locations/us-central1/queues/my-queue/tasks/1234","scheduleTime":"2017-11-01T22:27:53.628279Z"}'`) .wrap(120) .recommendCommands() .epilogue(`For more information, see https://cloud.google.com/cloud-tasks/docs`) .help() .strict()