@codiac.io/codiac-cli 1.3.3 → 1.3.5

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.
@@ -15,98 +15,103 @@ class NocClusterDestroy extends command_base_enterprise_1.CommandBaseEnterprise
15
15
  const { args, flags } = yield this.parse(NocClusterDestroy);
16
16
  (_a = this._relayContainer) === null || _a === void 0 ? void 0 : _a.ready$.subscribe((ready) => tslib_1.__awaiter(this, void 0, void 0, function* () {
17
17
  var _b, _c;
18
- if (flags.silent)
19
- this.__ui = new ops_1.ThrowingUserInputProvider(this.logger);
20
- this._userCntx = yield this.establishTenantContext(this._userCntx);
21
- let deleteIdentity = flags.deleteIdentity;
22
- // let clusterName: string | undefined;
23
- // if (!flags.name) {
24
- // let readResult = await this._codiacApi.ClusterDef.tryReadMany({ privateOwner: this._userCntx?.currentTenantCode! }, { projection: { pathsIncluded: ["id", "name", "locationName", "privateOwner"], pathsExcluded: [] } });
25
- // if (readResult.error) {
26
- // clusterName = <string>(await this._ui.prompt("clusterName", "Enter name of the cluster to destroy:", true));
27
- // deleteIdentity = await this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
28
- // } else if (readResult.success && readResult.output && readResult.output.length > 0) {
29
- // let clusterList = readResult.output;
30
- // if (flags.partials !== true) {
31
- // clusterList = clusterList.filter(c => c.instance != undefined)
32
- // }
33
- // let instances = clusterList.map(c => { return { name: `${c.name} [${c.locationName}]${c.privateOwner ? this._styler.dim(" Owner: [" + c.privateOwner + "]") : ""}`, value: c.name }; });
34
- // clusterName = (await this._ui.promptSelect("clusterName", "Select the cluster to destroy:", instances))!;
35
- // deleteIdentity = await this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
36
- // } else {
37
- // this._ui.userMessage("No clusters exist to destroy");
38
- // }
39
- // } else {
40
- // clusterName = flags.name; // TODO: Validate this and prompt for selection if not found.
41
- // }
42
- let cluster;
43
- let crit = { privateOwner: (_b = this._userCntx) === null || _b === void 0 ? void 0 : _b.currentTenantCode };
44
- let readResult = yield this._codiacApi.ClusterDef.tryReadMany(crit, { projection: { pathsIncluded: ["id", "name", "provider", "locationName", "privateOwner", "instance"], pathsExcluded: [] } });
45
- let clusterDefs = (_c = readResult.output) !== null && _c !== void 0 ? _c : []; // we can only deinit clusters that have an instance
46
- if (flags.partials !== true) {
47
- clusterDefs = clusterDefs.filter(c => c.instance != undefined);
48
- }
49
- let provider = (flags.provider) ? codiac_domain_1.CloudProviderEnum[flags.provider] : undefined;
50
- if (provider && Object.keys(codiac_domain_1.CloudProviderEnum).indexOf(provider) >= 0) {
51
- clusterDefs = clusterDefs.filter(c => c.provider == provider);
52
- }
53
- let confirm = false;
54
- if (readResult.error === undefined && clusterDefs.length === 0) {
55
- this._ui.userMessage("No clusters exist with instances to destroy");
56
- }
57
- else if (flags.silent) {
58
- cluster = { name: flags.name, provider: (provider) };
59
- }
60
- else {
61
- let candidate = {};
62
- if (flags.name)
63
- candidate.name = flags.name;
64
- do {
65
- if (readResult.error) {
66
- // if there is a problem with the cluster record, it may prevent a good read,
67
- // so we're going to allow the user to invoke the operation nonetheless.
68
- let allPvds = this.cspUiFactory.getAllProviders(this.ioc);
69
- const csp = yield this.cspContextualizer.promptForCloudProvider(allPvds, undefined);
70
- const name = (yield this._ui.prompt("clusterName", "Enter name of the cluster to destroy:", true));
71
- deleteIdentity = yield this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
72
- cluster = { name: name, provider: csp };
73
- }
74
- else { // if (readResult.success && readResult.output && readResult.output.length > 0) {
75
- let found = (candidate.name) ? clusterDefs.find(c => c.name === candidate.name) : undefined;
76
- if (found) {
77
- cluster = found;
18
+ try {
19
+ if (flags.silent)
20
+ this.__ui = new ops_1.ThrowingUserInputProvider(this.logger);
21
+ this._userCntx = yield this.establishTenantContext(this._userCntx);
22
+ let deleteIdentity = flags.deleteIdentity;
23
+ // let clusterName: string | undefined;
24
+ // if (!flags.name) {
25
+ // let readResult = await this._codiacApi.ClusterDef.tryReadMany({ privateOwner: this._userCntx?.currentTenantCode! }, { projection: { pathsIncluded: ["id", "name", "locationName", "privateOwner"], pathsExcluded: [] } });
26
+ // if (readResult.error) {
27
+ // clusterName = <string>(await this._ui.prompt("clusterName", "Enter name of the cluster to destroy:", true));
28
+ // deleteIdentity = await this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
29
+ // } else if (readResult.success && readResult.output && readResult.output.length > 0) {
30
+ // let clusterList = readResult.output;
31
+ // if (flags.partials !== true) {
32
+ // clusterList = clusterList.filter(c => c.instance != undefined)
33
+ // }
34
+ // let instances = clusterList.map(c => { return { name: `${c.name} [${c.locationName}]${c.privateOwner ? this._styler.dim(" Owner: [" + c.privateOwner + "]") : ""}`, value: c.name }; });
35
+ // clusterName = (await this._ui.promptSelect("clusterName", "Select the cluster to destroy:", instances))!;
36
+ // deleteIdentity = await this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
37
+ // } else {
38
+ // this._ui.userMessage("No clusters exist to destroy");
39
+ // }
40
+ // } else {
41
+ // clusterName = flags.name; // TODO: Validate this and prompt for selection if not found.
42
+ // }
43
+ let cluster;
44
+ let crit = { privateOwner: (_b = this._userCntx) === null || _b === void 0 ? void 0 : _b.currentTenantCode };
45
+ let readResult = yield this._codiacApi.ClusterDef.tryReadMany(crit, { projection: { pathsIncluded: ["id", "name", "provider", "locationName", "privateOwner", "instance"], pathsExcluded: [] } });
46
+ let clusterDefs = (_c = readResult.output) !== null && _c !== void 0 ? _c : []; // we can only deinit clusters that have an instance
47
+ if (flags.partials !== true) {
48
+ clusterDefs = clusterDefs.filter(c => c.instance != undefined);
49
+ }
50
+ let provider = (flags.provider) ? codiac_domain_1.CloudProviderEnum[flags.provider] : undefined;
51
+ if (provider && Object.keys(codiac_domain_1.CloudProviderEnum).indexOf(provider) >= 0) {
52
+ clusterDefs = clusterDefs.filter(c => c.provider == provider);
53
+ }
54
+ let confirm = false;
55
+ if (readResult.error === undefined && clusterDefs.length === 0) {
56
+ this._ui.userMessage("No clusters exist with instances to destroy");
57
+ }
58
+ else if (flags.silent) {
59
+ cluster = { name: flags.name, provider: (provider) };
60
+ }
61
+ else {
62
+ let candidate = {};
63
+ if (flags.name)
64
+ candidate.name = flags.name;
65
+ do {
66
+ if (readResult.error) {
67
+ // if there is a problem with the cluster record, it may prevent a good read,
68
+ // so we're going to allow the user to invoke the operation nonetheless.
69
+ let allPvds = this.cspUiFactory.getAllProviders(this.ioc);
70
+ const csp = yield this.cspContextualizer.promptForCloudProvider(allPvds, undefined);
71
+ const name = (yield this._ui.prompt("clusterName", "Enter name of the cluster to destroy:", true));
72
+ deleteIdentity = yield this._ui.promptConfirm("deleteIdentity", "Delete the cluster identity also?", false);
73
+ cluster = { name: name, provider: csp };
78
74
  }
79
- else {
80
- let choices = clusterDefs
81
- .map(c => { return { name: this.describe(c), value: c.name }; });
82
- const name = (yield this._ui.promptSelect("clusterName", "Select the cluster to destroy:", choices));
83
- let def = clusterDefs.find(c => c.name === name);
84
- cluster = { name: name, provider: def.provider };
75
+ else { // if (readResult.success && readResult.output && readResult.output.length > 0) {
76
+ let found = (candidate.name) ? clusterDefs.find(c => c.name === candidate.name) : undefined;
77
+ if (found) {
78
+ cluster = found;
79
+ }
80
+ else {
81
+ let choices = clusterDefs
82
+ .map(c => { return { name: this.describe(c), value: c.name }; });
83
+ const name = (yield this._ui.promptSelect("clusterName", "Select the cluster to destroy:", choices));
84
+ let def = clusterDefs.find(c => c.name === name);
85
+ cluster = { name: name, provider: def.provider };
86
+ }
87
+ }
88
+ let also = (deleteIdentity == true) ? " and its identity" : "";
89
+ confirm = yield this._ui.promptConfirm("confirmDestroy", `Destroy the physical cluster instance: ${this._styler.hilite(this.describe(cluster))}${also} ? `, false);
90
+ if (!confirm)
91
+ candidate = {}; // if cluster was set as a cmd flag, but they denied the confirm, this allows selecting a different one.
92
+ } while (confirm !== true);
93
+ }
94
+ if (cluster) {
95
+ if (confirm == true || flags.silent) {
96
+ if (!flags.silent) {
97
+ yield this.cspContextualizer.promptForCloudProviderCreds(this.ioc, cluster.provider);
85
98
  }
99
+ this._ui.startSpinner(`Destroying physical cluster instance: ${this._styler.hilite(cluster.name)}...`);
100
+ let result = yield this.genRelayClient.Call.postExecuteDeleteClusterInstance({ name: cluster.name, deleteIdentity: deleteIdentity });
101
+ this._ui.stopSpinner(result.success ? "SUCCESS" : "FAILED");
102
+ let msg = `Cluster destroy ${result.success ? this._styler.colorGood("SUCCESS") : this._styler.colorCritical("FAILED")}: ${result.message || ""}`;
103
+ this.logger.debug(msg, result);
104
+ this._ui.userMessage(msg);
86
105
  }
87
- let also = (deleteIdentity == true) ? " and its identity" : "";
88
- confirm = yield this._ui.promptConfirm("confirmDestroy", `Destroy the physical cluster instance: ${this._styler.hilite(this.describe(cluster))}${also} ? `, false);
89
- if (!confirm)
90
- candidate = {}; // if cluster was set as a cmd flag, but they denied the confirm, this allows selecting a different one.
91
- } while (confirm !== true);
92
- }
93
- if (cluster) {
94
- if (confirm == true || flags.silent) {
95
- if (!flags.silent) {
96
- yield this.cspContextualizer.promptForCloudProviderCreds(this.ioc, cluster.provider);
106
+ else {
107
+ this._ui.userMessage("Operation cancelled. No work was done.");
97
108
  }
98
- this._ui.startSpinner(`Destroying physical cluster instance: ${this._styler.hilite(cluster.name)}...`);
99
- let result = yield this.genRelayClient.Call.postExecuteDeleteClusterInstance({ name: cluster.name, deleteIdentity: deleteIdentity });
100
- this._ui.stopSpinner(result.success ? "SUCCESS" : "FAILED");
101
- let msg = `Cluster destroy ${result.success ? this._styler.colorGood("SUCCESS") : this._styler.colorCritical("FAILED")}: ${result.message || ""}`;
102
- this.logger.debug(msg, result);
103
- this._ui.userMessage(msg);
104
- }
105
- else {
106
- this._ui.userMessage("Operation cancelled. No work was done.");
107
109
  }
110
+ resolve();
111
+ }
112
+ catch (err) {
113
+ reject(err);
108
114
  }
109
- resolve();
110
115
  }));
111
116
  }
112
117
  catch (err) {
@@ -1 +1 @@
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AI,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACvF,QAAQ,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;IACtG,cAAc,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,mJAAmJ,EAAE,CAAC;IAC/O,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,iCAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IACpJ,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,kFAAkF,iBAAiB,CAAC,SAAS,EAAE,EAAE,CAAC;CAC5N,CAAA;AAEM,sBAAI,GAAG;IACZ,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;CACnE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { CommandBaseExecTenant } from '../../../command-base-exec-tenant';
2
+ import { OutputFormatEnum } from '../../../cli-entities/output-format-enum';
3
+ import { InteractionModes } from '../../asset/view';
4
+ interface IClusterJournalRequest {
5
+ /** Cluster name. */
6
+ cluster: string;
7
+ outputFormat: OutputFormatEnum;
8
+ }
9
+ export default class NocClusterJournal extends CommandBaseExecTenant<IClusterJournalRequest> {
10
+ static description: string;
11
+ static aliases: string[];
12
+ static examples: string[];
13
+ static flags: {
14
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ "to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ "take-defaults": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ };
20
+ static args: {
21
+ cluster: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
22
+ };
23
+ protected adminOnly: boolean;
24
+ captureArgs(): Promise<[Partial<IClusterJournalRequest>, InteractionModes | undefined, boolean]>;
25
+ buildCandidate_silently(partial: Partial<IClusterJournalRequest>): Promise<IClusterJournalRequest | undefined>;
26
+ buildCandidate_interactively(partial: Partial<IClusterJournalRequest>, takeDefaults: boolean): Promise<IClusterJournalRequest | undefined>;
27
+ buildCommandString(candidate: IClusterJournalRequest, cmd: string[]): string[];
28
+ executeTask(candidate: IClusterJournalRequest): Promise<void>;
29
+ private loadClusters;
30
+ /** Renders a user-friendly cluster description. */
31
+ private describe;
32
+ /** Returns the name of the selected cluster.
33
+ */
34
+ private promptForCluster;
35
+ }
36
+ export {};
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const _ = require("lodash");
6
+ const YAML = require("yaml");
7
+ const command_base_exec_tenant_1 = require("../../../command-base-exec-tenant");
8
+ const output_format_enum_1 = require("../../../cli-entities/output-format-enum");
9
+ const view_1 = require("../../asset/view");
10
+ const prettify_1 = require("../../../prettify");
11
+ const clusterProjxn = { pathsIncluded: ["id", "name", "provider", "locationName", "instance", "modified", "modifiedBy"], pathsExcluded: [] };
12
+ class NocClusterJournal extends command_base_exec_tenant_1.CommandBaseExecTenant {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.adminOnly = false;
16
+ }
17
+ captureArgs() {
18
+ var _a, _b;
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ const { args, flags } = yield this.parse(NocClusterJournal);
21
+ let partial = {};
22
+ if (flags.output)
23
+ partial.outputFormat = output_format_enum_1.OutputFormatEnum[flags.output];
24
+ if (args.cluster)
25
+ partial.cluster = args.cluster;
26
+ // ---------------------------------------------------------------
27
+ // TODO: move everything from here down into the base class
28
+ // ---------------------------------------------------------------
29
+ const interactionMode = (this.pipedInput) ? view_1.InteractionModes.silent : (_b = (_a = undefined !== null && undefined !== void 0 ? undefined : (flags.echo ? view_1.InteractionModes.echo : undefined)) !== null && _a !== void 0 ? _a : (flags["to-script"] ? view_1.InteractionModes.toscript : undefined)) !== null && _b !== void 0 ? _b : (flags.silent ? view_1.InteractionModes.silent : undefined);
30
+ const takeDefaults = flags['take-defaults'];
31
+ return [partial, interactionMode, takeDefaults];
32
+ });
33
+ }
34
+ // /** Throws on invalid */
35
+ // private validate(partial: Partial<IAuthRoleDef>): void {
36
+ // if (partial.name == undefined || _.isEmpty(partial.name)) throw new Error("Missing name");
37
+ // let rxName = /^[a-zA-Z][a-zA-Z0-9-]{2,50}$/;
38
+ // if (!rxName.test(partial.name)) throw new Error("Invalid name: must be 3- to 50-character string of alphanumerics and hyphens, starting with a letter.");
39
+ // }
40
+ buildCandidate_silently(partial) {
41
+ var _a;
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ if (partial.cluster == undefined || _.isEmpty(partial.cluster)) {
44
+ throw new Error("You must specify a cluster in silent mode.");
45
+ }
46
+ let clusters = yield this.loadClusters();
47
+ if (clusters.find(c => c.name == partial.cluster) == undefined) {
48
+ throw new Error("Cluster not found.");
49
+ }
50
+ let candidate = {
51
+ cluster: partial.cluster,
52
+ outputFormat: (_a = partial.outputFormat) !== null && _a !== void 0 ? _a : output_format_enum_1.OutputFormatEnum.pretty
53
+ };
54
+ return candidate;
55
+ });
56
+ }
57
+ buildCandidate_interactively(partial, takeDefaults) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ let clusters = yield this.loadClusters();
60
+ let selected;
61
+ if (clusters.length == 1 && (takeDefaults == true)) {
62
+ selected = clusters[0];
63
+ }
64
+ else {
65
+ selected = yield this.promptForCluster(clusters, partial.cluster);
66
+ }
67
+ partial.cluster = selected.name;
68
+ // Prompt for output format
69
+ return yield this.buildCandidate_silently(partial);
70
+ });
71
+ }
72
+ buildCommandString(candidate, cmd) {
73
+ cmd.push("--output", candidate.outputFormat);
74
+ cmd.push("--silent");
75
+ cmd.push(candidate.cluster);
76
+ return cmd;
77
+ }
78
+ executeTask(candidate) {
79
+ var _a, _b, _c, _d;
80
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
+ if ([output_format_enum_1.OutputFormatEnum.json, output_format_enum_1.OutputFormatEnum.yaml].includes(candidate.outputFormat) === false)
82
+ this._ui.startSpinner("Retrieving");
83
+ let crit = { resourceId: candidate.cluster };
84
+ let result = yield this._codiacApi.SetupJournal.tryReadMany(crit);
85
+ let doneMsg = (result.error) ? "Error" : "Found ".concat(((_b = (_a = result.output) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0).toString());
86
+ if ([output_format_enum_1.OutputFormatEnum.json, output_format_enum_1.OutputFormatEnum.yaml].includes(candidate.outputFormat) === false)
87
+ this._ui.stopSpinner(doneMsg);
88
+ if (result.error)
89
+ throw result.error;
90
+ let journal = (result.output && (((_d = (_c = result.output) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0)) ? result.output[0] : undefined;
91
+ if (journal == undefined) {
92
+ this._ui.userMessage("That cluster has no setup journal.");
93
+ }
94
+ else {
95
+ // RENDER
96
+ let output = "";
97
+ switch (candidate.outputFormat) {
98
+ case output_format_enum_1.OutputFormatEnum.yaml:
99
+ output = YAML.stringify(journal, { indent: 2 });
100
+ this._ui.userMessage(output);
101
+ break;
102
+ case output_format_enum_1.OutputFormatEnum.json:
103
+ output = JSON.stringify(journal, undefined, 2);
104
+ this._ui.userMessage(output);
105
+ break;
106
+ case output_format_enum_1.OutputFormatEnum.pretty:
107
+ default:
108
+ output = (0, prettify_1.prettify)(journal);
109
+ this._ui.userMessage(output);
110
+ break;
111
+ }
112
+ }
113
+ return;
114
+ });
115
+ }
116
+ loadClusters() {
117
+ var _a, _b;
118
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
119
+ try {
120
+ let readResult = yield this._codiacApi.ClusterDef.tryReadMany({ all: true }, { projection: clusterProjxn });
121
+ let clusterDefs = (_b = (_a = readResult.output) === null || _a === void 0 ? void 0 : _a.map(c => c)) !== null && _b !== void 0 ? _b : [];
122
+ clusterDefs = _.orderBy(clusterDefs, c => c.name);
123
+ return clusterDefs;
124
+ }
125
+ catch (err) {
126
+ throw err;
127
+ }
128
+ });
129
+ }
130
+ /** Renders a user-friendly cluster description. */
131
+ describe(cluster) {
132
+ return `${cluster.name} ${this._styler.dim("(" + cluster.provider + (cluster.locationName ? ", " + cluster.locationName : "") + ")")}`;
133
+ }
134
+ /** Returns the name of the selected cluster.
135
+ */
136
+ promptForCluster(clusters, defaultValue) {
137
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
138
+ let output;
139
+ let keep = false;
140
+ if (defaultValue && clusters.find(c => c.name === defaultValue)) {
141
+ keep = yield this._ui.promptConfirm("clusterNameConfirm", `Target Cluster: [${this._styler.hilite(defaultValue)}]`, true);
142
+ }
143
+ if (keep === true) {
144
+ output = clusters.find(c => c.name === defaultValue);
145
+ }
146
+ else {
147
+ let choices = clusters
148
+ .map(c => { return { name: this.describe(c), value: c.name }; });
149
+ let selectedName = (yield this._ui.promptSelect("clusterName", "Select the target cluster:", choices));
150
+ output = clusters.find(c => c.name === selectedName);
151
+ }
152
+ return output;
153
+ });
154
+ }
155
+ }
156
+ exports.default = NocClusterJournal;
157
+ NocClusterJournal.description = 'Shows the setup journal for the given cluster. The journal outlines the individual components that were created in the CSP subscription (Cloud Service Provider) comprising the cluster.';
158
+ NocClusterJournal.aliases = ["cluster:journal"];
159
+ NocClusterJournal.examples = [
160
+ '<%= config.bin %> <%= command.id %>',
161
+ '<%= config.bin %> <%= command.id %> --echo',
162
+ '<%= config.bin %> <%= command.id %> dev-west-aws-02',
163
+ '<%= config.bin %> <%= command.id %> -o yaml dev-west-aws-02',
164
+ '<%= config.bin %> <%= command.id %> -o yaml --silent dev-west-aws-02',
165
+ '<%= config.bin %> <%= command.id %> -o yaml --silent dev-west-aws-02 > myfiles/journal.yaml'
166
+ ];
167
+ NocClusterJournal.flags = {
168
+ output: core_1.Flags.string({ char: 'o', default: output_format_enum_1.OutputFormatEnum.pretty, description: "format in which to render the data.", options: [output_format_enum_1.OutputFormatEnum.json, output_format_enum_1.OutputFormatEnum.yaml, output_format_enum_1.OutputFormatEnum.pretty] }),
169
+ // TODO: Move these into the base class
170
+ silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.' }),
171
+ echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.' }),
172
+ "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' }),
173
+ "take-defaults": core_1.Flags.boolean({ exclusive: ["silent"], description: "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode). This behavior does NOT apply to scenarios that the command needs to override invalid user input; such cases will always prompt for confirmation. eg: when no argument was provided for file or type, and only one exists, the system will render the autoselected file unless this flag is set." })
174
+ };
175
+ NocClusterJournal.args = {
176
+ cluster: core_1.Args.string({ description: 'Name of the cluster in Codiac. You can use `cod cluster list` to see the names of your codiac clusters.' }),
177
+ };
178
+ //# sourceMappingURL=journal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../../src/commands/noc/cluster/journal.ts"],"names":[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EAAE,CAAC;IAC5L,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,sGAAsG,EAAE,CAAC;IAClL,eAAe,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,ycAAyc,EAAE,CAAC;CAClhB,CAAA;AAEM,sBAAI,GAAG;IACZ,OAAO,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0GAA0G,EAAE,CAAC;CAClJ,CAAA"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.3",
2
+ "version": "1.3.5",
3
3
  "commands": {
4
4
  "branch": {
5
5
  "id": "branch",
@@ -8189,6 +8189,86 @@
8189
8189
  }
8190
8190
  }
8191
8191
  },
8192
+ "noc:cluster:journal": {
8193
+ "id": "noc:cluster:journal",
8194
+ "description": "Shows the setup journal for the given cluster. The journal outlines the individual components that were created in the CSP subscription (Cloud Service Provider) comprising the cluster.",
8195
+ "strict": true,
8196
+ "pluginName": "@codiac.io/codiac-cli",
8197
+ "pluginAlias": "@codiac.io/codiac-cli",
8198
+ "pluginType": "core",
8199
+ "aliases": [
8200
+ "cluster:journal"
8201
+ ],
8202
+ "hiddenAliases": [],
8203
+ "examples": [
8204
+ "<%= config.bin %> <%= command.id %>",
8205
+ "<%= config.bin %> <%= command.id %> --echo",
8206
+ "<%= config.bin %> <%= command.id %> dev-west-aws-02",
8207
+ "<%= config.bin %> <%= command.id %> -o yaml dev-west-aws-02",
8208
+ "<%= config.bin %> <%= command.id %> -o yaml --silent dev-west-aws-02",
8209
+ "<%= config.bin %> <%= command.id %> -o yaml --silent dev-west-aws-02 > myfiles/journal.yaml"
8210
+ ],
8211
+ "flags": {
8212
+ "output": {
8213
+ "name": "output",
8214
+ "type": "option",
8215
+ "char": "o",
8216
+ "description": "format in which to render the data.",
8217
+ "multiple": false,
8218
+ "options": [
8219
+ "json",
8220
+ "yaml",
8221
+ "pretty"
8222
+ ],
8223
+ "default": "pretty"
8224
+ },
8225
+ "silent": {
8226
+ "name": "silent",
8227
+ "type": "boolean",
8228
+ "description": "Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.",
8229
+ "allowNo": false,
8230
+ "exclusive": [
8231
+ "echo",
8232
+ "to-script"
8233
+ ]
8234
+ },
8235
+ "echo": {
8236
+ "name": "echo",
8237
+ "type": "boolean",
8238
+ "description": "Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.",
8239
+ "allowNo": false,
8240
+ "exclusive": [
8241
+ "to-script",
8242
+ "silent"
8243
+ ]
8244
+ },
8245
+ "to-script": {
8246
+ "name": "to-script",
8247
+ "type": "boolean",
8248
+ "description": "Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.",
8249
+ "allowNo": false,
8250
+ "exclusive": [
8251
+ "echo",
8252
+ "silent"
8253
+ ]
8254
+ },
8255
+ "take-defaults": {
8256
+ "name": "take-defaults",
8257
+ "type": "boolean",
8258
+ "description": "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode). This behavior does NOT apply to scenarios that the command needs to override invalid user input; such cases will always prompt for confirmation. eg: when no argument was provided for file or type, and only one exists, the system will render the autoselected file unless this flag is set.",
8259
+ "allowNo": false,
8260
+ "exclusive": [
8261
+ "silent"
8262
+ ]
8263
+ }
8264
+ },
8265
+ "args": {
8266
+ "cluster": {
8267
+ "name": "cluster",
8268
+ "description": "Name of the cluster in Codiac. You can use `cod cluster list` to see the names of your codiac clusters."
8269
+ }
8270
+ }
8271
+ },
8192
8272
  "noc:cluster:list": {
8193
8273
  "id": "noc:cluster:list",
8194
8274
  "description": "Shows the list of clusters.",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codiac.io/codiac-cli",
3
3
  "description": "Local command line interface for managing enterprise assets and environments",
4
- "version": "1.3.3",
4
+ "version": "1.3.5",
5
5
  "author": "Codiac",
6
6
  "bin": {
7
7
  "codiac": "./bin/run",