UNPKG

@rockset/cli

Version:
58 lines (54 loc) 2.53 kB
"use strict"; /* eslint-disable unicorn/filename-case */ // Generated file, please do not edit directly Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const core_2 = require("@rockset/core"); const util_1 = require("../../../helper/util"); const base_command_1 = require("../../../base-command"); const chalk = require("chalk"); const cli_ux_1 = require("cli-ux"); const bodySchema = ``; let DeleteCollection = /** @class */ (() => { class DeleteCollection extends base_command_1.RockCommand { async run() { const { args, flags } = await this.parse(DeleteCollection); // Rockset client object const client = await core_2.main.createClient(); const namedArgs = DeleteCollection.args; // apicall const apicall = client.collections.deleteCollection.bind(client.collections); // endpoint const endpoint = '/v1/orgs/self/ws/{workspace}/collections/{collection}'; const method = 'DELETE'; await util_1.runApiCall.bind(this)({ args, flags, namedArgs, apicall, method, endpoint, bodySchema }); } } DeleteCollection.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), raw: core_1.Flags.boolean({ description: 'Show the raw output from the server, instead of grabbing the results. Usually used in conjunction with --output=json', }) }, cli_ux_1.cli.table.flags({ only: ['columns', 'output'] })); DeleteCollection.args = [ { name: 'workspace', description: 'name of the workspace', required: true, hidden: false, }, { name: 'collection', description: 'name of the collection', required: true, hidden: false, }, ]; DeleteCollection.description = `delete a collection and all its documents from rockset Arguments to this command will be passed as URL parameters to ${chalk.bold(`DELETE: /v1/orgs/self/ws/{workspace}/collections/{collection}`)} Endpoint Reference DELETE: /v1/orgs/self/ws/{workspace}/collections/{collection} Delete Collection Delete a collection and all its documents from Rockset. More documentation at ${chalk.underline(`https://docs.rockset.com/rest-api#deletecollection`)}`; DeleteCollection.examples = ['$ rockset api:collections:deleteCollection WORKSPACE COLLECTION']; return DeleteCollection; })(); exports.default = DeleteCollection;