@codiac.io/codiac-cli 1.3.59 → 1.3.61

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/codiac-relay/gen/client.d.ts +5 -2
  3. package/dist/apis/codiac-relay/gen/client.js +28 -0
  4. package/dist/apis/codiac-relay/gen/client.js.map +1 -1
  5. package/dist/apis/codiac-relay/gen/contracts.d.ts +12 -0
  6. package/dist/apis/codiac-relay/gen/contracts.js.map +1 -1
  7. package/dist/codiac-entities/cluster-capture-def.d.ts +2 -0
  8. package/dist/codiac-entities/cluster-capture-def.js +3 -0
  9. package/dist/codiac-entities/cluster-capture-def.js.map +1 -0
  10. package/dist/command-base-exec-tenant.d.ts +3 -2
  11. package/dist/command-base-exec-tenant.js +3 -2
  12. package/dist/command-base-exec-tenant.js.map +1 -1
  13. package/dist/commands/cabinet/create.js +2 -2
  14. package/dist/commands/cluster/connect.d.ts +0 -1
  15. package/dist/commands/cluster/connect.js +2 -3
  16. package/dist/commands/cluster/connect.js.map +1 -1
  17. package/dist/commands/noc/cluster/capture.d.ts +30 -0
  18. package/dist/commands/noc/cluster/capture.js +165 -0
  19. package/dist/commands/noc/cluster/capture.js.map +1 -0
  20. package/dist/commands/noc/cluster/forget.d.ts +18 -5
  21. package/dist/commands/noc/cluster/forget.js +117 -49
  22. package/dist/commands/noc/cluster/forget.js.map +1 -1
  23. package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.d.ts +7 -1
  24. package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.js +5 -0
  25. package/dist/uilogic/cloud-resource-configurators/aws-resource-configurator.js.map +1 -1
  26. package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.d.ts +8 -1
  27. package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.js +102 -5
  28. package/dist/uilogic/cloud-resource-configurators/azure-resource-configurator.js.map +1 -1
  29. package/dist/uilogic/i-cluster-configurator.d.ts +6 -1
  30. package/dist/uilogic/type-safety-utils.d.ts +22 -0
  31. package/dist/uilogic/type-safety-utils.js +59 -0
  32. package/dist/uilogic/type-safety-utils.js.map +1 -0
  33. package/oclif.manifest.json +151 -14
  34. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { Command } from '@oclif/core';
2
+ import { RootMap } from '../../../apis/codiac-api/contracts';
3
+ import { ClusterCaptureDef } from '../../../codiac-entities/cluster-capture-def';
4
+ import { CommandBaseExecTenant } from '../../../command-base-exec-tenant';
5
+ import { InteractionModes } from '../../../uilogic/config-ui-utils';
6
+ export default class NocClusterCapture extends CommandBaseExecTenant<ClusterCaptureDef> {
7
+ static description: string;
8
+ static dependsOn: string[];
9
+ static aliases: string[];
10
+ static flags: {
11
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
12
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ provider: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ providerSubscription: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ location: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ azResourceGroup: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
+ silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ "to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ static args: {};
22
+ static examples: Command.Example[];
23
+ private get uiCloudPvd();
24
+ private _uiCloudPvd_backer;
25
+ captureArgs(): Promise<[Partial<ClusterCaptureDef>, InteractionModes | undefined, boolean]>;
26
+ buildCandidate_silently(partial: Partial<ClusterCaptureDef>, rootMap: RootMap): Promise<ClusterCaptureDef | undefined>;
27
+ buildCandidate_interactively(partial: Partial<ClusterCaptureDef>, takeDefaults: boolean, rootMap: RootMap): Promise<ClusterCaptureDef | undefined>;
28
+ buildCommandString(candidate: ClusterCaptureDef, cmd: string[]): string[];
29
+ executeTask(candidate: ClusterCaptureDef): Promise<void>;
30
+ }
@@ -0,0 +1,165 @@
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 prettify_1 = require("../../../prettify");
7
+ const cloud_provider_contextualizer_1 = require("../../../uilogic/cloud-provider-contextualizer");
8
+ const contracts_1 = require("../../../apis/codiac-relay/contracts");
9
+ const command_base_exec_tenant_1 = require("../../../command-base-exec-tenant");
10
+ const config_ui_utils_1 = require("../../../uilogic/config-ui-utils");
11
+ class NocClusterCapture extends command_base_exec_tenant_1.CommandBaseExecTenant {
12
+ get uiCloudPvd() {
13
+ if (this._uiCloudPvd_backer === undefined) {
14
+ this._uiCloudPvd_backer = this.ioc.get(cloud_provider_contextualizer_1.CloudProviderContextualizer);
15
+ }
16
+ return this._uiCloudPvd_backer;
17
+ }
18
+ captureArgs() {
19
+ var _a, _b;
20
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
21
+ const { args, flags } = yield this.parse(NocClusterCapture);
22
+ // 1. Set initial property values from cmd args
23
+ let partial = {
24
+ name: flags.name,
25
+ provider: flags.provider,
26
+ providerSubscription: flags.providerSubscription,
27
+ locationName: flags.location,
28
+ providerGroup: flags.azResourceGroup
29
+ };
30
+ // ---------------------------------------------------------------
31
+ // TODO: move everything from here down into the base class
32
+ // ---------------------------------------------------------------
33
+ const interactionMode = (this.pipedInput) ? config_ui_utils_1.InteractionModes.silent : (_b = (_a = undefined !== null && undefined !== void 0 ? undefined : (flags.echo ? config_ui_utils_1.InteractionModes.echo : undefined)) !== null && _a !== void 0 ? _a : (flags["to-script"] ? config_ui_utils_1.InteractionModes.toscript : undefined)) !== null && _b !== void 0 ? _b : (flags.silent ? config_ui_utils_1.InteractionModes.silent : undefined);
34
+ const takeDefaults = flags['take-defaults'];
35
+ return [partial, interactionMode, takeDefaults];
36
+ });
37
+ }
38
+ buildCandidate_silently(partial, rootMap) {
39
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
+ if (partial.name == undefined || _.isEmpty(partial.name))
41
+ throw new Error("Missing cluster name.");
42
+ if (partial.provider == undefined || _.isEmpty(partial.provider))
43
+ throw new Error("Missing cloud service provider.");
44
+ if (partial.providerSubscription == undefined || _.isEmpty(partial.providerSubscription))
45
+ throw new Error("Missing cloud service provider subscription Id.");
46
+ if (partial.locationName == undefined || _.isEmpty(partial.locationName))
47
+ throw new Error("Missing cluster location.");
48
+ if (contracts_1.CloudProviderEnum[partial.provider] == undefined)
49
+ throw new Error("Invalid cloud service provider.");
50
+ if (contracts_1.CloudProviderEnum[partial.provider] == contracts_1.CloudProviderEnum.azure && partial.providerGroup == undefined)
51
+ throw new Error("Missing Azure resource group.");
52
+ let candidate = {
53
+ name: partial.name,
54
+ provider: partial.provider,
55
+ providerSubscription: partial.providerSubscription,
56
+ locationName: partial.locationName,
57
+ providerGroup: partial.providerGroup
58
+ };
59
+ return candidate;
60
+ });
61
+ }
62
+ buildCandidate_interactively(partial, takeDefaults, rootMap) {
63
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
64
+ let defaults; // This is a leftover legacy pattern. TODO: refactor into partial/candidate pattern.
65
+ let confirmed = false;
66
+ do {
67
+ console.clear();
68
+ this._ui.userMessage(this._styler.bold("Capture Cluster:"));
69
+ // TODO: ask to change before prompting the list
70
+ let allPvds = this.cspUiFactory.getAllProviders(this.ioc);
71
+ partial.provider = yield this.uiCloudPvd.promptForCloudProvider(allPvds, partial.provider);
72
+ let cspUser = yield this.uiCloudPvd.promptForCloudProviderCreds(this.ioc, partial.provider, undefined, undefined, undefined, partial.providerSubscription);
73
+ // Adhere to the subscription of the current csp user (if any specified).
74
+ if (partial.providerSubscription == undefined && cspUser.subscriptionId) {
75
+ partial.providerSubscription = cspUser.subscriptionId;
76
+ }
77
+ // load up the cluster configurator for the given clouduprovider
78
+ let regCfg = this.cspUiFactory.create(partial.provider, this.ioc);
79
+ let def = yield regCfg.defineClusterCaptureParams(partial, rootMap, defaults); // note: "defaults" gets mutated here
80
+ defaults = def.defaults;
81
+ partial = def.spec;
82
+ // console.clear();
83
+ let msg = (0, prettify_1.prettify)(partial);
84
+ this._ui.userMessage(msg);
85
+ this._ui.userMessage(`You are about to capture this cluster. Continue?`);
86
+ confirmed = yield this._ui.promptConfirm("confirmCreate", `(hit 'N' to edit your input)`, false);
87
+ } while (!confirmed);
88
+ let candidate = {
89
+ name: partial.name,
90
+ provider: partial.provider,
91
+ providerSubscription: partial.providerSubscription,
92
+ locationName: partial.locationName,
93
+ providerGroup: partial.providerGroup
94
+ };
95
+ return candidate;
96
+ });
97
+ }
98
+ buildCommandString(candidate, cmd) {
99
+ cmd.push("--silent");
100
+ cmd.push("-n", candidate.name);
101
+ cmd.push("-p", candidate.provider);
102
+ cmd.push("-s", candidate.providerSubscription);
103
+ cmd.push("-l", candidate.locationName);
104
+ if (candidate.provider == contracts_1.CloudProviderEnum.azure) {
105
+ cmd.push("-g", candidate.providerGroup);
106
+ }
107
+ return cmd;
108
+ }
109
+ executeTask(candidate) {
110
+ var _a, _b;
111
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
112
+ // ----------------------------------------------------
113
+ // THIS IS NOT the design we're looking for.
114
+ // TODO: Use the request as the candidate and just fire it here.
115
+ let req = {
116
+ provider: candidate.provider,
117
+ providerSubscriptionId: candidate.providerSubscription,
118
+ name: candidate.name
119
+ };
120
+ if (candidate.provider == contracts_1.CloudProviderEnum.aws)
121
+ req.awsRegion = candidate.locationName;
122
+ if (candidate.provider == contracts_1.CloudProviderEnum.azure)
123
+ req.azureResourceGroup = candidate.providerGroup;
124
+ // ----------------------------------------------------
125
+ let result = yield this.genRelayClient.Call.ClusterCapture(req);
126
+ if (result.error != undefined) {
127
+ throw result.error;
128
+ }
129
+ else if (result.success == true) {
130
+ this._ui.userMessage((_a = result.message) !== null && _a !== void 0 ? _a : "Successfully captured ".concat("[", candidate.provider, "] cluster ", "[", candidate.name, "]"));
131
+ }
132
+ else {
133
+ this._ui.userMessage((_b = result.message) !== null && _b !== void 0 ? _b : "Cluster ".concat("[", candidate.name, "] was not found in the given [", candidate.provider, "] subscription."));
134
+ }
135
+ });
136
+ }
137
+ }
138
+ exports.default = NocClusterCapture;
139
+ NocClusterCapture.description = "Creates a new record in Codiac for a cluster that already physically exists in a cloud subscription. \
140
+ You will need credentials for the cloud service provider subscription you are drawing the cluster from. \
141
+ Use `cod csp login` to capture your credentials. \
142
+ Use `cod cluster forget ---running` to undo this operation.";
143
+ NocClusterCapture.dependsOn = ["name", "provider", "providerSubscription", "location"];
144
+ NocClusterCapture.aliases = ["cluster:capture"];
145
+ NocClusterCapture.flags = {
146
+ help: core_1.Flags.help({ char: 'h' }),
147
+ name: core_1.Flags.string({ char: 'n', description: 'Name of the cluster to capture' }),
148
+ provider: core_1.Flags.string({ char: 'p', required: false, options: [contracts_1.CloudProviderEnum.azure, contracts_1.CloudProviderEnum.aws], description: 'Cloud service provider on which to find the cluster' }),
149
+ providerSubscription: core_1.Flags.string({ char: 's', required: false, description: 'The cloud provider subscription Id under which to find the cluster (eg: SubscriptionId for azure, AccountId for aws).' }),
150
+ location: core_1.Flags.string({ char: 'l', required: false, description: 'The short name of the regional data center in which the cliuster resides.' }),
151
+ azResourceGroup: core_1.Flags.string({ char: 'g', required: false, description: '(required for Azure) The Azure resource group in which to find the cluster.' }),
152
+ // TODO: Move these into the base class
153
+ silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], dependsOn: ["name", "provider", "providerSubscription", "location"], description: 'Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.' }),
154
+ 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.' }),
155
+ "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' })
156
+ // "take-defaults": 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." })
157
+ };
158
+ NocClusterCapture.args = {};
159
+ NocClusterCapture.examples = [
160
+ { description: "Capture a cluster interatively.", command: "cod cluster capture" },
161
+ { description: "Capture an Azure cluster silently.", command: "cod cluster capture -n my-cluster -p azure -s abcd123-xyzpdq-5678-pdq345 -l eastus -g our-dev-stuff" },
162
+ { description: "Capture an AWS cluster silently.", command: "cod cluster capture -n my-cluster -p aws -s 123456789012 -l us-east-1" },
163
+ // { description: "Capture a cluster from params in a data file.", command: "cat myparams.json | cod cluster capture" },
164
+ ];
165
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../../src/commands/noc/cluster/capture.ts"],"names":[],"mappings":";;;AAAA,sCAA6C;AAC7C,4BAA6B;AAG7B,gDAA6C;AAC7C,kGAA6F;AAC7F,oEAAgG;AAEhG,gFAA0E;AAC1E,sEAAoE;AAGpE,MAAqB,iBAAkB,SAAQ,gDAAwC;IAsCrF,IAAY,UAAU;QACpB,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACzC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,2DAA2B,CAAC,CAAC;SACrE;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAGY,WAAW;;;YACtB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GA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EAAE,uEAAuE,EAAE;IACrI,wHAAwH;CACzH,CAAA"}
@@ -1,17 +1,30 @@
1
- import { CommandBaseEnterprise } from '../../../command-base-enterprise';
2
- export default class NocClusterForget extends CommandBaseEnterprise {
1
+ import { Command } from '@oclif/core';
2
+ import { ClusterDef, RootMap } from '../../../apis/codiac-api/contracts';
3
+ import { CommandBaseExecTenant } from '../../../command-base-exec-tenant';
4
+ import { InteractionModes } from '../../../uilogic/config-ui-utils';
5
+ interface ClusterForgetSpec extends Pick<ClusterDef, "name" | "provider" | "id"> {
6
+ running: boolean;
7
+ }
8
+ export default class NocClusterForget extends CommandBaseExecTenant<ClusterForgetSpec> {
3
9
  static description: string;
10
+ static examples: Command.Example[];
4
11
  static aliases: string[];
5
12
  static flags: {
6
13
  name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
14
  provider: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ running: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
16
  silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
17
  };
11
18
  static args: {};
12
- protected bootstrap(): void;
13
- run(): Promise<void>;
19
+ captureArgs(): Promise<[Partial<ClusterForgetSpec>, InteractionModes | undefined, boolean]>;
20
+ buildCandidate_silently(partial: Partial<ClusterForgetSpec>, rootMap: RootMap): Promise<ClusterForgetSpec | undefined>;
21
+ buildCandidate_interactively(partial: Partial<ClusterForgetSpec>, takeDefaults: boolean, rootMap: RootMap): Promise<ClusterForgetSpec | undefined>;
22
+ buildCommandString(candidate: ClusterForgetSpec, cmd: string[]): string[];
23
+ executeTask(candidate: ClusterForgetSpec): Promise<void>;
14
24
  private promptForCluster;
25
+ /** Seeks out all cabinet records that are situated in the given cluster. */
26
+ private findChildrenFor;
15
27
  /** Renders a user-friendly cluster description. */
16
28
  private describe;
17
29
  }
30
+ export {};
@@ -4,57 +4,93 @@ const tslib_1 = require("tslib");
4
4
  const _ = require("lodash");
5
5
  const core_1 = require("@oclif/core");
6
6
  const codiac_domain_1 = require("@codiac.io/codiac-domain");
7
- const ops_1 = require("../../../ops");
8
- const command_base_enterprise_1 = require("../../../command-base-enterprise");
9
- class NocClusterForget extends command_base_enterprise_1.CommandBaseEnterprise {
10
- bootstrap() {
11
- super.bootstrap();
7
+ const type_safety_utils_1 = require("../../../uilogic/type-safety-utils");
8
+ const command_base_exec_tenant_1 = require("../../../command-base-exec-tenant");
9
+ const config_ui_utils_1 = require("../../../uilogic/config-ui-utils");
10
+ class NocClusterForget extends command_base_exec_tenant_1.CommandBaseExecTenant {
11
+ captureArgs() {
12
+ var _a, _b;
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ const { args, flags } = yield this.parse(NocClusterForget);
15
+ let partial = {
16
+ provider: type_safety_utils_1.TypeSafetyUtils.toEnum(codiac_domain_1.CloudProviderEnum, flags.provider),
17
+ name: flags.name,
18
+ running: type_safety_utils_1.TypeSafetyUtils.toBoolean(flags.running)
19
+ };
20
+ // ---------------------------------------------------------------
21
+ // TODO: move everything from here down into the base class
22
+ // ---------------------------------------------------------------
23
+ const interactionMode = (this.pipedInput) ? config_ui_utils_1.InteractionModes.silent : (_b = (_a = undefined !== null && undefined !== void 0 ? undefined : (flags.echo ? config_ui_utils_1.InteractionModes.echo : undefined)) !== null && _a !== void 0 ? _a : (flags["to-script"] ? config_ui_utils_1.InteractionModes.toscript : undefined)) !== null && _b !== void 0 ? _b : (flags.silent ? config_ui_utils_1.InteractionModes.silent : undefined);
24
+ const takeDefaults = flags['take-defaults'];
25
+ return [partial, interactionMode, takeDefaults];
26
+ });
12
27
  }
13
- run() {
28
+ buildCandidate_silently(partial, rootMap) {
14
29
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
16
- var _a;
17
- try {
18
- this.bootstrap();
19
- const { args, flags } = yield this.parse(NocClusterForget);
20
- (_a = this._relayContainer) === null || _a === void 0 ? void 0 : _a.ready$.subscribe(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- if (flags.silent)
22
- this.__ui = new ops_1.ThrowingUserInputProvider(this.logger); // <--- Isnt this built into the command base somewhere?
23
- this._userCntx = yield this.establishTenantContext(this._userCntx);
24
- let provider = flags.provider ? codiac_domain_1.CloudProviderEnum[flags.provider] : undefined;
25
- let cluster = yield this.promptForCluster(flags.name, provider, flags.silent, flags.force);
26
- // Perform the delete...
27
- if (cluster) {
28
- this._ui.startSpinner(`Forgetting ${cluster.provider} cluster: ${this._styler.hilite(cluster.name)}...`);
29
- let result = yield this._codiacApi.ClusterDef.tryDelete({ id: cluster.id }, {});
30
- this._ui.stopSpinner(result.success ? "SUCCESS" : "FAILED");
31
- let msg = `Cluster forget ${result.success ? this._styler.colorGood("SUCCESS") : this._styler.colorCritical("FAILED")}: ${result.message || ""}`;
32
- this.logger.debug(msg, result);
33
- this._ui.userMessage(msg);
34
- }
35
- resolve();
36
- }));
37
- }
38
- catch (err) {
39
- reject(err);
40
- }
41
- }));
30
+ if (partial.name == undefined)
31
+ throw new Error("Cluster name was not provided.");
32
+ if (partial.provider == undefined)
33
+ throw new Error("Cloud service provider was not provided.");
34
+ let cluster = yield this.promptForCluster(partial.name, partial.provider, partial.running, true);
35
+ let candidate;
36
+ if (cluster) {
37
+ candidate = {
38
+ id: cluster.id,
39
+ name: cluster.name,
40
+ provider: cluster.provider
41
+ };
42
+ }
43
+ return candidate;
42
44
  });
43
45
  }
44
- promptForCluster(name, provider, silent, force) {
45
- var _a;
46
+ buildCandidate_interactively(partial, takeDefaults, rootMap) {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
+ let cluster = yield this.promptForCluster(partial.name, partial.provider, partial.running, false);
49
+ let candidate;
50
+ if (cluster) {
51
+ candidate = {
52
+ id: cluster.id,
53
+ name: cluster.name,
54
+ provider: cluster.provider
55
+ };
56
+ }
57
+ return candidate;
58
+ });
59
+ }
60
+ buildCommandString(candidate, cmd) {
61
+ cmd.push("--provider", candidate.provider);
62
+ cmd.push("--name", candidate.name);
63
+ if (candidate.running == true)
64
+ cmd.push("--running");
65
+ cmd.push("--silent");
66
+ return cmd;
67
+ }
68
+ executeTask(candidate) {
69
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
70
+ this._ui.startSpinner(`Forgetting ${candidate.provider} cluster: ${this._styler.hilite(candidate.name)}...`);
71
+ let result = yield this._codiacApi.ClusterDef.tryDelete({ id: candidate.id }, {});
72
+ this._ui.stopSpinner(result.success ? "SUCCESS" : "FAILED");
73
+ let msg = `Cluster forget ${result.success ? this._styler.colorGood("SUCCESS") : this._styler.colorCritical("FAILED")}: ${result.message || ""}`;
74
+ this.logger.debug(msg, result);
75
+ this._ui.userMessage(msg);
76
+ });
77
+ }
78
+ promptForCluster(name, provider, running, silent) {
79
+ var _a, _b, _c;
46
80
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
81
  try {
48
- // // Use the rootMap to determine if the slected cluster has any child envs or cabs
49
- // let rootMapResult = await this._codiacApi.Call.getRootMap({ all: true }, {});
50
- // if (rootMapResult.error) throw new Error(`Error loading entities: ${rootMapResult.message ?? rootMapResult.error.message}`);
51
- // if (rootMapResult.output == undefined) throw new Error(`Error enterprise entities: empty root map.`);
52
- // let rootMap = rootMapResult.output;
82
+ // // Use the rootMap to determine if the selected cluster has any child envs or cabs
83
+ let rootMapResult = yield this._codiacApi.Call.getRootMap({ all: true }, {});
84
+ if (rootMapResult.error)
85
+ throw new Error(`Error loading entities: ${(_a = rootMapResult.message) !== null && _a !== void 0 ? _a : rootMapResult.error.message}`);
86
+ if (rootMapResult.output == undefined)
87
+ throw new Error(`Error enterprise entities: empty root map.`);
88
+ let rootMap = rootMapResult.output;
53
89
  // this.logger.trace("rootmap", rootMap);
54
90
  // Get the list of clusters
55
91
  let cluster;
56
92
  let readResult = yield this._codiacApi.ClusterDef.tryReadMany({ all: true }, { projection: { pathsIncluded: ["id", "name", "provider", "locationName", "instance", "modified", "modifiedBy"], pathsExcluded: [] } });
57
- let clusterDefs = (_a = readResult.output) !== null && _a !== void 0 ? _a : [];
93
+ let clusterDefs = (_b = readResult.output) !== null && _b !== void 0 ? _b : [];
58
94
  clusterDefs = _.orderBy(clusterDefs, c => c.name);
59
95
  if (provider) {
60
96
  clusterDefs = clusterDefs.filter(c => c.provider == provider);
@@ -63,8 +99,9 @@ class NocClusterForget extends command_base_enterprise_1.CommandBaseEnterprise {
63
99
  this._ui.userMessage("No clusters found");
64
100
  }
65
101
  else {
66
- if (force != true)
67
- clusterDefs = clusterDefs.filter(c => c.instance == undefined); // we can only forget clusters that DO NOT have an instance
102
+ if (running !== true) {
103
+ clusterDefs = clusterDefs.filter(c => c.instance == undefined);
104
+ }
68
105
  if (readResult.error == undefined && clusterDefs.length === 0) {
69
106
  this._ui.userMessage("No clusters exist without instances");
70
107
  }
@@ -101,6 +138,17 @@ class NocClusterForget extends command_base_enterprise_1.CommandBaseEnterprise {
101
138
  cluster = (clusterDefs.find(c => c.name === name));
102
139
  }
103
140
  }
141
+ // Warnings
142
+ if (cluster.instance) {
143
+ // They wd have to have set the --running flag to get this,
144
+ // so this warning is redundant, but it's important enough to point out anyway.
145
+ this._ui.userMessage(`${this._styler.colorWarning("Warning!")} The ${cluster.provider} cluster [${cluster.name}] appears to still have a running instance.`);
146
+ }
147
+ let children = this.findChildrenFor(cluster.name, rootMap);
148
+ if (children > 0) {
149
+ // TODO: Any associated cabinets should be forgotten also (ie: Perform a cab obliterate without the infrx piece).
150
+ this._ui.userMessage(this._styler.colorWarning("Warning!").concat(" The ", cluster.provider, " cluster [", cluster.name, "] has ", (_c = this._styler) === null || _c === void 0 ? void 0 : _c.hilite("" + children), " existing cabinet(s)."));
151
+ }
104
152
  confirm = yield this._ui.promptConfirm("confirmForget", `Forget the cluster: ${this._styler.hilite(this.describe(cluster))} ? `, false);
105
153
  if (!confirm)
106
154
  candidate = {}; // if cluster was set as a cmd flag, but they denied the confirm, this allows selecting a different one.
@@ -114,25 +162,45 @@ class NocClusterForget extends command_base_enterprise_1.CommandBaseEnterprise {
114
162
  }
115
163
  });
116
164
  }
165
+ /** Seeks out all cabinet records that are situated in the given cluster. */
166
+ findChildrenFor(clusterName, rootMap) {
167
+ let envs = [];
168
+ let cabs = [];
169
+ for (let ent of rootMap.enterprises) {
170
+ for (let env of ent.environments) {
171
+ let theseCabs = env.cabinets.filter(c => c.cluster === clusterName);
172
+ if (theseCabs.length > 0) {
173
+ envs.push(env);
174
+ cabs.push(...theseCabs);
175
+ }
176
+ }
177
+ }
178
+ return cabs.length;
179
+ }
117
180
  /** Renders a user-friendly cluster description. */
118
181
  describe(cluster) {
119
182
  var _a;
120
183
  const UTF8_HEART = "\u2665";
121
- let dim1 = ` (${cluster.provider}, ${cluster.locationName}${_.isEmpty(cluster.instance) ? "" : ", " + UTF8_HEART})`;
184
+ let existing = _.isEmpty(cluster.instance) ? "" : " " + this._styler.colorWarning(UTF8_HEART);
185
+ let dim1 = ` (${cluster.provider}, ${cluster.locationName})`;
122
186
  let dim2 = ` (${new Date((_a = cluster.modified) !== null && _a !== void 0 ? _a : "").toLocaleDateString()}, by ${cluster.modifiedBy})`;
123
- return `${cluster.name} ${this._styler.dim(dim1)} ${this._styler.dim(dim2)}`;
187
+ return `${cluster.name}${existing} ${this._styler.dim(dim1)} ${this._styler.dim(dim2)}`;
124
188
  }
125
189
  }
126
190
  exports.default = NocClusterForget;
127
191
  NocClusterForget.description = "Permanently removes the record of a cluster. This command does NOT affect any infrastructure; it simply removes the cluster from the Codiac consciousness. You must remove all cabinets and environments in a cluster before forgetting it."; // TODO: Add this ---> Use `cod cluster capture` to re-acquire an existing but forgotten cluster.
128
- // static examples = [
129
- // '<%= config.bin %> <%= command.id %>',
130
- // ]
192
+ NocClusterForget.examples = [
193
+ { description: "Forget a cluster using interactive prompts:", command: '<%= config.bin %> <%= command.id %>' },
194
+ { description: "Forget an aws cluster:", command: "<%= config.bin %> <%= command.id %> --provider aws --name my-cluster" },
195
+ { description: "Forget an azure cluster:", command: "<%= config.bin %> <%= command.id %> --provider azure --name my-other-cluster" },
196
+ { description: "Forget an azure cluster in silent mode:", command: "<%= config.bin %> <%= command.id %> --provider azure --name my-other-cluster --silent" },
197
+ { description: "Forget a cluster that is not destroyed yet:", command: "<%= config.bin %> <%= command.id %> --running" },
198
+ ];
131
199
  NocClusterForget.aliases = ["cluster:forget"];
132
200
  NocClusterForget.flags = {
133
201
  name: core_1.Flags.string({ char: 'n', required: false, description: 'Name of the cluster.' }),
134
202
  provider: core_1.Flags.string({ char: 'p', options: Object.keys(codiac_domain_1.CloudProviderEnum), required: false, description: 'Code for the cloud service provider.' }),
135
- force: core_1.Flags.boolean({ char: 'f', description: 'Allows inclusion of clusters with physical instances.' }),
203
+ running: core_1.Flags.boolean({ char: 'r', required: false, default: false, description: 'Include clusters that still have a running instance.' }),
136
204
  silent: core_1.Flags.boolean({ char: 'y', dependsOn: ["name", "provider"], required: false, description: `(Optional: defaults to false) Prevents confirmations of user-values. Required: ["name", "provider"]` })
137
205
  };
138
206
  NocClusterForget.args = {};
@@ -1 +1 @@
1
- {"version":3,"file":"forget.js","sourceRoot":"","sources":["../../../../src/commands/noc/cluster/forget.ts"],"names":[],"mappings":";;;AAAA,4BAA6B;AAC7B,sCAAmC;AAEnC,4DAA6D;AAC7D,sCAAyD;AAEzD,8EAAwE;AAExE,MAAqB,gBAAiB,SAAQ,+CAAqB;IAqBvD,SAAS;QACjB,KAAK,CAAC,SAAS,EAAE,CAAC;IACpB,CAAC;IAGY,GAAG;;YACd,OAAO,IAAI,OAAO,CAAO,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;;gBACjD,IAAI;oBACF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACjB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC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8
  import { ISecretStoreConfigurator } from "../i-secret-store-configurator";
9
9
  import { AwsSecretStoreDef, SecretStoreDef } from "../../relay/contracts";
10
10
  import { AwsIdentity, CloudProviderUser, FileStoreDef, LogintoCloudProviderRequest } from "../../apis/codiac-relay/contracts";
11
+ import { ClusterCaptureDef } from "../../codiac-entities/cluster-capture-def";
11
12
  import { IFileStoreConfigurator } from "../i-file-store-configurator";
13
+ import { IClusterConfigurator } from "../i-cluster-configurator";
12
14
  export type AwsProprietaryInput = {
13
15
  sessionToken?: string | undefined;
14
16
  };
15
17
  /** Walks the user through the selection of an existing
16
18
  * or the declaration of a new image registry.
17
19
  */
18
- export declare class AwsResourceConfigurator implements IFileStoreConfigurator, IRegistryConfigurator, ILoginConfigurator, ISecretStoreConfigurator {
20
+ export declare class AwsResourceConfigurator implements IFileStoreConfigurator, IRegistryConfigurator, ILoginConfigurator, ISecretStoreConfigurator, IClusterConfigurator {
19
21
  private genRelayClient;
20
22
  private codiacUser;
21
23
  private _ui;
@@ -38,6 +40,10 @@ export declare class AwsResourceConfigurator implements IFileStoreConfigurator,
38
40
  spec: ClusterDef;
39
41
  defaults: Partial<ClusterDef>;
40
42
  }>;
43
+ defineClusterCaptureParams(initial: Partial<ClusterDef>, defaults?: Partial<ClusterDef>): Promise<{
44
+ spec: ClusterCaptureDef;
45
+ defaults: Partial<ClusterDef>;
46
+ }>;
41
47
  private promptForNodeSpec;
42
48
  private promptForLocation;
43
49
  /** Asks the user whether to keep the default version, and if not presents a select list. */
@@ -280,6 +280,11 @@ let AwsResourceConfigurator = class AwsResourceConfigurator {
280
280
  }));
281
281
  });
282
282
  }
283
+ defineClusterCaptureParams(initial, defaults) {
284
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
285
+ throw new Error("Cluster capture not yet implemented for AWS.");
286
+ });
287
+ }
283
288
  promptForNodeSpec(defaultValue) {
284
289
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
285
290
  let output;