@bifos/nhncloud-cli 0.14.0 → 0.15.0
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.
- package/README.md +6 -3
- package/dist/index.js +318 -277
- package/package.json +1 -1
- package/skills/nhncloud-cli/SKILL.md +1 -1
- package/skills/nhncloud-cli/references/deploy.md +42 -43
- package/skills/nhncloud-cli/references/logncrash.md +37 -0
- package/skills/nhncloud-cli/references/ncr.md +5 -7
- package/skills/nhncloud-cli/references/ncs.md +37 -39
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
27
|
var import_commander57 = require("commander");
|
|
28
|
-
var
|
|
28
|
+
var import_chalk18 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/utils/spinner.ts
|
|
31
31
|
var import_ora = __toESM(require("ora"));
|
|
@@ -56,6 +56,12 @@ function stopSpinner(success, text) {
|
|
|
56
56
|
current = null;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// src/config/credentials.ts
|
|
60
|
+
var import_promises = require("fs/promises");
|
|
61
|
+
var import_node_os = require("os");
|
|
62
|
+
var import_node_path = require("path");
|
|
63
|
+
var import_chalk = __toESM(require("chalk"));
|
|
64
|
+
|
|
59
65
|
// src/utils/errors.ts
|
|
60
66
|
var NhnCloudCliError = class extends Error {
|
|
61
67
|
constructor(message, exitCode) {
|
|
@@ -66,85 +72,13 @@ var NhnCloudCliError = class extends Error {
|
|
|
66
72
|
exitCode;
|
|
67
73
|
};
|
|
68
74
|
|
|
69
|
-
// src/utils/terminal.ts
|
|
70
|
-
function sanitizeForTerminal(value) {
|
|
71
|
-
return value.replace(/[\x00-\x1F\x7F]/g, "?");
|
|
72
|
-
}
|
|
73
|
-
function sanitizeMultilineForTerminal(value) {
|
|
74
|
-
return value.replace(/[\x00-\x09\x0B-\x1F\x7F]/g, "?");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// src/api/timeout.ts
|
|
78
|
-
var SYNC_FLOOR_MS = 6e5;
|
|
79
|
-
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
80
|
-
var SYNC_TIMEOUT_MS = SYNC_FLOOR_MS;
|
|
81
|
-
function setRequestTimeoutMs(ms) {
|
|
82
|
-
if (!Number.isInteger(ms) || ms < 1) {
|
|
83
|
-
throw new Error(`setRequestTimeoutMs: 1 \uC774\uC0C1\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${String(ms)}).`);
|
|
84
|
-
}
|
|
85
|
-
DEFAULT_TIMEOUT_MS = ms;
|
|
86
|
-
SYNC_TIMEOUT_MS = Math.max(ms, SYNC_FLOOR_MS);
|
|
87
|
-
}
|
|
88
|
-
function getRequestTimeoutMs() {
|
|
89
|
-
return DEFAULT_TIMEOUT_MS;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
75
|
// src/utils/exit-codes.ts
|
|
93
76
|
var EXIT_API_ERROR = 1;
|
|
94
77
|
var EXIT_AUTH_ERROR = 2;
|
|
95
78
|
var EXIT_PARAM_ERROR = 3;
|
|
96
79
|
var EXIT_CONFIG_ERROR = 4;
|
|
97
80
|
|
|
98
|
-
// src/commands/parse-options.ts
|
|
99
|
-
var POSITIVE_INTEGER_PATTERN = /^[1-9]\d*$/;
|
|
100
|
-
var NON_NEGATIVE_INTEGER_PATTERN = /^(0|[1-9]\d*)$/;
|
|
101
|
-
function parseRequiredArgument(value, label) {
|
|
102
|
-
const trimmed = value.trim();
|
|
103
|
-
if (!trimmed) {
|
|
104
|
-
throw new NhnCloudCliError(`${label} \uC778\uC218\uAC00 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
105
|
-
}
|
|
106
|
-
return trimmed;
|
|
107
|
-
}
|
|
108
|
-
function describeRange({ min, max }) {
|
|
109
|
-
if (min !== void 0 && max !== void 0) return `${min} \uC774\uC0C1 ${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
110
|
-
if (min !== void 0) return `${min} \uC774\uC0C1\uC758 \uC815\uC218`;
|
|
111
|
-
if (max !== void 0) return `${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
112
|
-
return "0 \uC774\uC0C1\uC758 \uC815\uC218";
|
|
113
|
-
}
|
|
114
|
-
function throwIntegerOptionError(value, flag, range) {
|
|
115
|
-
throw new NhnCloudCliError(
|
|
116
|
-
`${flag} \uB294 ${describeRange(range)}\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${JSON.stringify(value)}).`,
|
|
117
|
-
EXIT_PARAM_ERROR
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
function parseIntegerOption(value, flag, range) {
|
|
121
|
-
if (value === void 0) return void 0;
|
|
122
|
-
const pattern = range.min !== void 0 && range.min > 0 ? POSITIVE_INTEGER_PATTERN : NON_NEGATIVE_INTEGER_PATTERN;
|
|
123
|
-
if (!pattern.test(value)) {
|
|
124
|
-
throwIntegerOptionError(value, flag, range);
|
|
125
|
-
}
|
|
126
|
-
const parsed = Number(value);
|
|
127
|
-
if (!Number.isInteger(parsed) || range.min !== void 0 && parsed < range.min || range.max !== void 0 && parsed > range.max) {
|
|
128
|
-
throwIntegerOptionError(value, flag, range);
|
|
129
|
-
}
|
|
130
|
-
return parsed;
|
|
131
|
-
}
|
|
132
|
-
function parsePositiveIntegerOption(value, flag) {
|
|
133
|
-
return parseIntegerOption(value, flag, { min: 1 });
|
|
134
|
-
}
|
|
135
|
-
function parseNonNegativeIntegerOption(value, flag) {
|
|
136
|
-
return parseIntegerOption(value, flag, { min: 0 });
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// src/commands/configure.ts
|
|
140
|
-
var import_commander = require("commander");
|
|
141
|
-
var import_chalk = __toESM(require("chalk"));
|
|
142
|
-
var import_core = require("@inquirer/core");
|
|
143
|
-
|
|
144
81
|
// src/config/credentials.ts
|
|
145
|
-
var import_promises = require("fs/promises");
|
|
146
|
-
var import_node_os = require("os");
|
|
147
|
-
var import_node_path = require("path");
|
|
148
82
|
var CREDENTIALS_PATH = (0, import_node_path.join)((0, import_node_os.homedir)(), ".nhncloud", "credentials.json");
|
|
149
83
|
var CONFIG_PATH = (0, import_node_path.join)((0, import_node_os.homedir)(), ".nhncloud", "config.json");
|
|
150
84
|
function isCredentials(value) {
|
|
@@ -203,22 +137,24 @@ nhncloud configure \uB97C \uC2E4\uD589\uD574 \uC790\uACA9\uC99D\uBA85\uC744 \uC1
|
|
|
203
137
|
}
|
|
204
138
|
return parsed;
|
|
205
139
|
}
|
|
206
|
-
async function
|
|
140
|
+
async function readConfigJson() {
|
|
207
141
|
let raw;
|
|
208
142
|
try {
|
|
209
143
|
raw = await (0, import_promises.readFile)(CONFIG_PATH, "utf-8");
|
|
210
144
|
} catch {
|
|
211
145
|
return null;
|
|
212
146
|
}
|
|
213
|
-
let parsed;
|
|
214
147
|
try {
|
|
215
|
-
|
|
148
|
+
return JSON.parse(raw);
|
|
216
149
|
} catch {
|
|
217
150
|
throw new NhnCloudCliError(
|
|
218
151
|
`\uC124\uC815 \uD30C\uC77C \uD30C\uC2F1 \uC624\uB958: ${CONFIG_PATH} \u2014 \uC62C\uBC14\uB978 JSON \uD615\uC2DD\uC778\uC9C0 \uD655\uC778\uD558\uC138\uC694.`,
|
|
219
152
|
EXIT_CONFIG_ERROR
|
|
220
153
|
);
|
|
221
154
|
}
|
|
155
|
+
}
|
|
156
|
+
async function loadConfig() {
|
|
157
|
+
const parsed = await readConfigJson();
|
|
222
158
|
if (!isConfig(parsed)) {
|
|
223
159
|
return null;
|
|
224
160
|
}
|
|
@@ -353,20 +289,98 @@ async function setIaasCredential(profileName, iaas) {
|
|
|
353
289
|
creds.profiles[profileName] = { ...profile, iaas };
|
|
354
290
|
await saveCredentials(creds);
|
|
355
291
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const targets =
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
);
|
|
292
|
+
function isLegacyDeployConfig(value) {
|
|
293
|
+
if (typeof value !== "object" || value === null) return false;
|
|
294
|
+
const targets = value["targets"];
|
|
295
|
+
return targets === void 0 || typeof targets === "object" && targets !== null;
|
|
296
|
+
}
|
|
297
|
+
async function warnLegacyDeployTargets() {
|
|
298
|
+
let parsed;
|
|
299
|
+
try {
|
|
300
|
+
parsed = await readConfigJson();
|
|
301
|
+
} catch (err) {
|
|
302
|
+
if (err instanceof NhnCloudCliError && err.exitCode === EXIT_CONFIG_ERROR) return;
|
|
303
|
+
throw err;
|
|
304
|
+
}
|
|
305
|
+
if (typeof parsed !== "object" || parsed === null) return;
|
|
306
|
+
const deploy = parsed["deploy"];
|
|
307
|
+
if (!isLegacyDeployConfig(deploy)) return;
|
|
308
|
+
if (!deploy.targets || Object.keys(deploy.targets).length === 0) return;
|
|
309
|
+
process.stderr.write(
|
|
310
|
+
import_chalk.default.yellow(
|
|
311
|
+
"\uACBD\uACE0: config.json \uC758 deploy.targets \uB294 \uB354 \uC774\uC0C1 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. appkey \uB294 nhncloud configure --deploy-appkey \uB85C \uC62E\uAE30\uACE0, \uB098\uBA38\uC9C0 \uC88C\uD45C\uB294 --artifact-id \uB4F1 \uC635\uC158\uC73C\uB85C \uB118\uAE30\uC138\uC694.\n"
|
|
312
|
+
)
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// src/utils/terminal.ts
|
|
317
|
+
function sanitizeForTerminal(value) {
|
|
318
|
+
return value.replace(/[\x00-\x1F\x7F]/g, "?");
|
|
319
|
+
}
|
|
320
|
+
function sanitizeMultilineForTerminal(value) {
|
|
321
|
+
return value.replace(/[\x00-\x09\x0B-\x1F\x7F]/g, "?");
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// src/api/timeout.ts
|
|
325
|
+
var SYNC_FLOOR_MS = 6e5;
|
|
326
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
327
|
+
var SYNC_TIMEOUT_MS = SYNC_FLOOR_MS;
|
|
328
|
+
function setRequestTimeoutMs(ms) {
|
|
329
|
+
if (!Number.isInteger(ms) || ms < 1) {
|
|
330
|
+
throw new Error(`setRequestTimeoutMs: 1 \uC774\uC0C1\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${String(ms)}).`);
|
|
367
331
|
}
|
|
368
|
-
|
|
332
|
+
DEFAULT_TIMEOUT_MS = ms;
|
|
333
|
+
SYNC_TIMEOUT_MS = Math.max(ms, SYNC_FLOOR_MS);
|
|
334
|
+
}
|
|
335
|
+
function getRequestTimeoutMs() {
|
|
336
|
+
return DEFAULT_TIMEOUT_MS;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/commands/parse-options.ts
|
|
340
|
+
var POSITIVE_INTEGER_PATTERN = /^[1-9]\d*$/;
|
|
341
|
+
var NON_NEGATIVE_INTEGER_PATTERN = /^(0|[1-9]\d*)$/;
|
|
342
|
+
function parseRequiredArgument(value, label) {
|
|
343
|
+
const trimmed = value.trim();
|
|
344
|
+
if (!trimmed) {
|
|
345
|
+
throw new NhnCloudCliError(`${label} \uC778\uC218\uAC00 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
346
|
+
}
|
|
347
|
+
return trimmed;
|
|
348
|
+
}
|
|
349
|
+
function describeRange({ min, max }) {
|
|
350
|
+
if (min !== void 0 && max !== void 0) return `${min} \uC774\uC0C1 ${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
351
|
+
if (min !== void 0) return `${min} \uC774\uC0C1\uC758 \uC815\uC218`;
|
|
352
|
+
if (max !== void 0) return `${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
353
|
+
return "0 \uC774\uC0C1\uC758 \uC815\uC218";
|
|
354
|
+
}
|
|
355
|
+
function throwIntegerOptionError(value, flag, range) {
|
|
356
|
+
throw new NhnCloudCliError(
|
|
357
|
+
`${flag} \uB294 ${describeRange(range)}\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${JSON.stringify(value)}).`,
|
|
358
|
+
EXIT_PARAM_ERROR
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
function parseIntegerOption(value, flag, range) {
|
|
362
|
+
if (value === void 0) return void 0;
|
|
363
|
+
const pattern = range.min !== void 0 && range.min > 0 ? POSITIVE_INTEGER_PATTERN : NON_NEGATIVE_INTEGER_PATTERN;
|
|
364
|
+
if (!pattern.test(value)) {
|
|
365
|
+
throwIntegerOptionError(value, flag, range);
|
|
366
|
+
}
|
|
367
|
+
const parsed = Number(value);
|
|
368
|
+
if (!Number.isInteger(parsed) || range.min !== void 0 && parsed < range.min || range.max !== void 0 && parsed > range.max) {
|
|
369
|
+
throwIntegerOptionError(value, flag, range);
|
|
370
|
+
}
|
|
371
|
+
return parsed;
|
|
369
372
|
}
|
|
373
|
+
function parsePositiveIntegerOption(value, flag) {
|
|
374
|
+
return parseIntegerOption(value, flag, { min: 1 });
|
|
375
|
+
}
|
|
376
|
+
function parseNonNegativeIntegerOption(value, flag) {
|
|
377
|
+
return parseIntegerOption(value, flag, { min: 0 });
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// src/commands/configure.ts
|
|
381
|
+
var import_commander = require("commander");
|
|
382
|
+
var import_chalk2 = __toESM(require("chalk"));
|
|
383
|
+
var import_core = require("@inquirer/core");
|
|
370
384
|
|
|
371
385
|
// src/api/oauth.ts
|
|
372
386
|
var import_ky2 = __toESM(require("ky"));
|
|
@@ -1907,12 +1921,12 @@ async function verifyLogncrash(uak, appkey) {
|
|
|
1907
1921
|
}
|
|
1908
1922
|
|
|
1909
1923
|
// src/commands/configure.ts
|
|
1910
|
-
async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigateway, doVerify, logncrashUak = uak) {
|
|
1924
|
+
async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigateway, deploy, doVerify, logncrashUak = uak) {
|
|
1911
1925
|
if (doVerify) {
|
|
1912
1926
|
if (uak) {
|
|
1913
1927
|
const ok = await verifyUserAccessKey(uak);
|
|
1914
1928
|
if (ok) {
|
|
1915
|
-
process.stderr.write(
|
|
1929
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 UAK \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1916
1930
|
} else {
|
|
1917
1931
|
throw new NhnCloudCliError(
|
|
1918
1932
|
"UAK \uC778\uC99D \uC2E4\uD328 \u2014 uak-id / uak-secret \uC744 \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1929,7 +1943,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1929
1943
|
}
|
|
1930
1944
|
const ok = await verifyLogncrash(logncrashUak, logncrash.appkey ?? "");
|
|
1931
1945
|
if (ok) {
|
|
1932
|
-
process.stderr.write(
|
|
1946
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 logncrash \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1933
1947
|
} else {
|
|
1934
1948
|
throw new NhnCloudCliError(
|
|
1935
1949
|
"logncrash \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK\uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1940,7 +1954,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1940
1954
|
if (iaas) {
|
|
1941
1955
|
const ok = await verifyIaas(iaas);
|
|
1942
1956
|
if (ok) {
|
|
1943
|
-
process.stderr.write(
|
|
1957
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 iaas \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1944
1958
|
} else {
|
|
1945
1959
|
throw new NhnCloudCliError(
|
|
1946
1960
|
"iaas \uC778\uC99D \uC2E4\uD328 \u2014 tenantId / username / API \uBE44\uBC00\uBC88\uD638\uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1953,7 +1967,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1953
1967
|
const appkey = ncr.appkey ?? "";
|
|
1954
1968
|
const ok = await verifyNcr(uak, appkey);
|
|
1955
1969
|
if (ok) {
|
|
1956
|
-
process.stderr.write(
|
|
1970
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 ncr \uC5F0\uACB0 \uC131\uACF5 (kr1)\n"));
|
|
1957
1971
|
} else {
|
|
1958
1972
|
throw new NhnCloudCliError(
|
|
1959
1973
|
"ncr \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK \uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1962,7 +1976,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1962
1976
|
}
|
|
1963
1977
|
} else {
|
|
1964
1978
|
process.stderr.write(
|
|
1965
|
-
|
|
1979
|
+
import_chalk2.default.yellow(
|
|
1966
1980
|
" \u26A0 ncr verify \uAC74\uB108\uB700 \u2014 \uC774\uBC88 \uC124\uC815\uC5D0 UAK \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. ncr \uBA85\uB839\uC740 \uACF5\uD1B5 UAK \uAC00 \uD544\uC694\uD558\uB2C8 \uBA3C\uC800 \uC124\uC815\uD558\uC138\uC694.\n"
|
|
1967
1981
|
)
|
|
1968
1982
|
);
|
|
@@ -1973,7 +1987,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1973
1987
|
const appkey = ncs.appkey ?? "";
|
|
1974
1988
|
const ok = await verifyNcs(uak, appkey);
|
|
1975
1989
|
if (ok) {
|
|
1976
|
-
process.stderr.write(
|
|
1990
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 ncs \uC5F0\uACB0 \uC131\uACF5 (kr1)\n"));
|
|
1977
1991
|
} else {
|
|
1978
1992
|
throw new NhnCloudCliError(
|
|
1979
1993
|
"ncs \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK \uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1982,7 +1996,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1982
1996
|
}
|
|
1983
1997
|
} else {
|
|
1984
1998
|
process.stderr.write(
|
|
1985
|
-
|
|
1999
|
+
import_chalk2.default.yellow(
|
|
1986
2000
|
" \u26A0 ncs verify \uAC74\uB108\uB700 \u2014 \uC774\uBC88 \uC124\uC815\uC5D0 UAK \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. ncs \uBA85\uB839\uC740 \uACF5\uD1B5 UAK \uAC00 \uD544\uC694\uD558\uB2C8 \uBA3C\uC800 \uC124\uC815\uD558\uC138\uC694.\n"
|
|
1987
2001
|
)
|
|
1988
2002
|
);
|
|
@@ -2007,7 +2021,10 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
2007
2021
|
if (apigateway) {
|
|
2008
2022
|
await setServiceCredential(profileName, "apigateway", apigateway);
|
|
2009
2023
|
}
|
|
2010
|
-
|
|
2024
|
+
if (deploy) {
|
|
2025
|
+
await setServiceCredential(profileName, "deploy", deploy);
|
|
2026
|
+
}
|
|
2027
|
+
process.stderr.write(import_chalk2.default.green(`
|
|
2011
2028
|
\u2713 profile "${profileName}" \uC124\uC815\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
2012
2029
|
`));
|
|
2013
2030
|
}
|
|
@@ -2038,7 +2055,7 @@ async function runInteractive(opts) {
|
|
|
2038
2055
|
}
|
|
2039
2056
|
}
|
|
2040
2057
|
if (!uak) {
|
|
2041
|
-
process.stderr.write(
|
|
2058
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 \uAC1C\uC778 UAK (User Access Key) \u2014\n"));
|
|
2042
2059
|
const uakId = await input({
|
|
2043
2060
|
message: "UAK ID"
|
|
2044
2061
|
});
|
|
@@ -2054,7 +2071,7 @@ async function runInteractive(opts) {
|
|
|
2054
2071
|
default: false
|
|
2055
2072
|
});
|
|
2056
2073
|
if (setupLogncrash) {
|
|
2057
|
-
process.stderr.write(
|
|
2074
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 logncrash \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2058
2075
|
const appkey = await input({
|
|
2059
2076
|
message: "logncrash appkey",
|
|
2060
2077
|
validate: (v) => v.trim().length > 0 || "logncrash appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
@@ -2067,9 +2084,9 @@ async function runInteractive(opts) {
|
|
|
2067
2084
|
default: false
|
|
2068
2085
|
});
|
|
2069
2086
|
if (setupIaas) {
|
|
2070
|
-
process.stderr.write(
|
|
2087
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 iaas (Compute) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2071
2088
|
process.stderr.write(
|
|
2072
|
-
|
|
2089
|
+
import_chalk2.default.yellow(
|
|
2073
2090
|
" \u203B password \uB294 NHN Cloud \uCF58\uC194 IAM \uC758 API \uBE44\uBC00\uBC88\uD638\uC785\uB2C8\uB2E4 (\uB85C\uADF8\uC778 \uBE44\uBC00\uBC88\uD638\uAC00 \uC544\uB2D9\uB2C8\uB2E4).\n"
|
|
2074
2091
|
)
|
|
2075
2092
|
);
|
|
@@ -2095,7 +2112,7 @@ async function runInteractive(opts) {
|
|
|
2095
2112
|
default: false
|
|
2096
2113
|
});
|
|
2097
2114
|
if (setupNcr) {
|
|
2098
|
-
process.stderr.write(
|
|
2115
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 ncr (Container Registry) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2099
2116
|
const ncrAppkey = await input({
|
|
2100
2117
|
message: "ncr appkey",
|
|
2101
2118
|
validate: (v) => v.trim().length > 0 || "ncr appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
@@ -2108,38 +2125,51 @@ async function runInteractive(opts) {
|
|
|
2108
2125
|
default: false
|
|
2109
2126
|
});
|
|
2110
2127
|
if (setupNcs) {
|
|
2111
|
-
process.stderr.write(
|
|
2128
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 ncs (Container Service) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2112
2129
|
const ncsAppkey = await input({
|
|
2113
2130
|
message: "ncs appkey",
|
|
2114
2131
|
validate: (v) => v.trim().length > 0 || "ncs appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
2115
2132
|
});
|
|
2116
2133
|
ncs = { appkey: ncsAppkey.trim() };
|
|
2117
2134
|
}
|
|
2135
|
+
let deploy;
|
|
2136
|
+
const setupDeploy = await confirm({
|
|
2137
|
+
message: "deploy \uC790\uACA9\uC99D\uBA85\uB3C4 \uC124\uC815\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
2138
|
+
default: false
|
|
2139
|
+
});
|
|
2140
|
+
if (setupDeploy) {
|
|
2141
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 deploy \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2142
|
+
const deployAppkey = await input({
|
|
2143
|
+
message: "deploy appkey",
|
|
2144
|
+
validate: (v) => v.trim().length > 0 || "deploy appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
2145
|
+
});
|
|
2146
|
+
deploy = { appkey: deployAppkey.trim() };
|
|
2147
|
+
}
|
|
2118
2148
|
if (opts.verify) {
|
|
2119
|
-
process.stderr.write(
|
|
2149
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 \uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC911\u2026 \u2014\n"));
|
|
2120
2150
|
}
|
|
2121
2151
|
if (opts.verify) {
|
|
2122
2152
|
try {
|
|
2123
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, true, uak);
|
|
2153
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, true, uak);
|
|
2124
2154
|
} catch (err) {
|
|
2125
2155
|
if (err instanceof NhnCloudCliError && err.exitCode === EXIT_AUTH_ERROR) {
|
|
2126
|
-
process.stderr.write(
|
|
2156
|
+
process.stderr.write(import_chalk2.default.red(` \u2717 ${sanitizeMultilineForTerminal(err.message)}
|
|
2127
2157
|
`));
|
|
2128
2158
|
const saveDespite = await confirm({
|
|
2129
2159
|
message: "\uAC80\uC99D \uC2E4\uD328\uC5D0\uB3C4 \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
2130
2160
|
default: false
|
|
2131
2161
|
});
|
|
2132
2162
|
if (!saveDespite) {
|
|
2133
|
-
process.stderr.write(
|
|
2163
|
+
process.stderr.write(import_chalk2.default.yellow("\uC800\uC7A5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
2134
2164
|
return;
|
|
2135
2165
|
}
|
|
2136
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, false, uak);
|
|
2166
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, false, uak);
|
|
2137
2167
|
} else {
|
|
2138
2168
|
throw err;
|
|
2139
2169
|
}
|
|
2140
2170
|
}
|
|
2141
2171
|
} else {
|
|
2142
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, false, uak);
|
|
2172
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, false, uak);
|
|
2143
2173
|
}
|
|
2144
2174
|
}
|
|
2145
2175
|
async function runNonInteractive(opts) {
|
|
@@ -2163,9 +2193,12 @@ async function runNonInteractive(opts) {
|
|
|
2163
2193
|
if (opts.apigatewayAppkey !== void 0 && opts.apigatewayAppkey.trim().length === 0) {
|
|
2164
2194
|
throw new NhnCloudCliError("--apigateway-appkey \uAC12\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
2165
2195
|
}
|
|
2196
|
+
if (opts.deployAppkey !== void 0 && opts.deployAppkey.trim().length === 0) {
|
|
2197
|
+
throw new NhnCloudCliError("--deploy-appkey \uAC12\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
2198
|
+
}
|
|
2166
2199
|
if (opts.logncrashSecret !== void 0) {
|
|
2167
2200
|
process.stderr.write(
|
|
2168
|
-
|
|
2201
|
+
import_chalk2.default.yellow(
|
|
2169
2202
|
"\uACBD\uACE0: --logncrash-secret\uC740 \uD3D0\uAE30 \uC608\uC815\uC774\uBA70 Search v3 \uC778\uC99D\uC5D0 \uC0AC\uC6A9\uD558\uAC70\uB098 \uC800\uC7A5\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n"
|
|
2170
2203
|
)
|
|
2171
2204
|
);
|
|
@@ -2182,9 +2215,10 @@ async function runNonInteractive(opts) {
|
|
|
2182
2215
|
const ncr = opts.ncrAppkey?.trim() ? { appkey: opts.ncrAppkey.trim() } : void 0;
|
|
2183
2216
|
const ncs = opts.ncsAppkey?.trim() ? { appkey: opts.ncsAppkey.trim() } : void 0;
|
|
2184
2217
|
const apigateway = opts.apigatewayAppkey?.trim() ? { appkey: opts.apigatewayAppkey.trim() } : void 0;
|
|
2185
|
-
|
|
2218
|
+
const deploy = opts.deployAppkey?.trim() ? { appkey: opts.deployAppkey.trim() } : void 0;
|
|
2219
|
+
if (!uak && !logncrash && !iaas && !ncr && !ncs && !apigateway && !deploy) {
|
|
2186
2220
|
throw new NhnCloudCliError(
|
|
2187
|
-
"\uBE44\uB300\uD654\uD615 \uBAA8\uB4DC: --uak-id + UAK secret, --logncrash-appkey,\n--iaas-tenant-id + --iaas-username + iaas password,\n--ncr-appkey, --ncs-appkey, \uB610\uB294 --
|
|
2221
|
+
"\uBE44\uB300\uD654\uD615 \uBAA8\uB4DC: --uak-id + UAK secret, --logncrash-appkey,\n--iaas-tenant-id + --iaas-username + iaas password,\n--ncr-appkey, --ncs-appkey, --apigateway-appkey, \uB610\uB294 --deploy-appkey\n\uC911 \uD558\uB098\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.\nsecret/password \uB294 \uB178\uCD9C \uBC29\uC9C0\uB97C \uC704\uD574 \uD658\uACBD\uBCC0\uC218 \uAD8C\uC7A5:\nNHNCLOUD_UAK_SECRET / NHNCLOUD_IAAS_PASSWORD.",
|
|
2188
2222
|
EXIT_PARAM_ERROR
|
|
2189
2223
|
);
|
|
2190
2224
|
}
|
|
@@ -2193,7 +2227,7 @@ async function runNonInteractive(opts) {
|
|
|
2193
2227
|
logncrashUak = await getUserAccessKey(profileName);
|
|
2194
2228
|
}
|
|
2195
2229
|
if (opts.verify) {
|
|
2196
|
-
process.stderr.write(
|
|
2230
|
+
process.stderr.write(import_chalk2.default.gray("\uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC911\u2026\n"));
|
|
2197
2231
|
}
|
|
2198
2232
|
await saveAndVerify(
|
|
2199
2233
|
profileName,
|
|
@@ -2203,6 +2237,7 @@ async function runNonInteractive(opts) {
|
|
|
2203
2237
|
ncr,
|
|
2204
2238
|
ncs,
|
|
2205
2239
|
apigateway,
|
|
2240
|
+
deploy,
|
|
2206
2241
|
opts.verify,
|
|
2207
2242
|
logncrashUak
|
|
2208
2243
|
);
|
|
@@ -2210,8 +2245,8 @@ async function runNonInteractive(opts) {
|
|
|
2210
2245
|
var configureCommand = new import_commander.Command("configure").description("\uC790\uACA9\uC99D\uBA85 \uC124\uC815 \uB9C8\uBC95\uC0AC (\uB300\uD654\uD615 + flag)").option("--profile <name>", "\uB300\uC0C1 profile \uC774\uB984 (\uAE30\uBCF8: default)").option("--uak-id <id>", "\uAC1C\uC778 UAK ID (\uBE44\uB300\uD654\uD615)").option("--uak-secret <secret>", "\uAC1C\uC778 UAK Secret (\uBE44\uB300\uD654\uD615, \uB178\uCD9C \uBC29\uC9C0\uB85C env NHNCLOUD_UAK_SECRET \uAD8C\uC7A5)").option("--logncrash-appkey <key>", "logncrash appkey (\uBE44\uB300\uD654\uD615)").option("--logncrash-secret <secret>", "\uD3D0\uAE30 \uC608\uC815: Search v3\uC5D0\uC11C\uB294 \uC0AC\uC6A9\xB7\uC800\uC7A5\uD558\uC9C0 \uC54A\uC74C").option("--iaas-tenant-id <id>", "iaas tenantId / \uD504\uB85C\uC81D\uD2B8 ID (\uBE44\uB300\uD654\uD615)").option("--iaas-username <user>", "iaas IAM username (\uBE44\uB300\uD654\uD615)").option(
|
|
2211
2246
|
"--iaas-password <pass>",
|
|
2212
2247
|
"iaas API \uBE44\uBC00\uBC88\uD638 (\uBE44\uB300\uD654\uD615, \uB178\uCD9C \uBC29\uC9C0\uB85C env NHNCLOUD_IAAS_PASSWORD \uAD8C\uC7A5)"
|
|
2213
|
-
).option("--iaas-region <region>", "iaas region (\uAE30\uBCF8: kr1)", "kr1").option("--ncr-appkey <key>", "ncr appkey (\uBE44\uB300\uD654\uD615)").option("--ncs-appkey <key>", "ncs appkey (\uBE44\uB300\uD654\uD615)").option("--apigateway-appkey <key>", "API Gateway appkey (\uBE44\uB300\uD654\uD615)").option("--no-verify", "\uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC0DD\uB7B5").action(async (opts) => {
|
|
2214
|
-
const hasFlag = opts.uakId !== void 0 || opts.uakSecret !== void 0 || opts.logncrashAppkey !== void 0 || opts.logncrashSecret !== void 0 || opts.iaasTenantId !== void 0 || opts.iaasUsername !== void 0 || opts.iaasPassword !== void 0 || opts.ncrAppkey !== void 0 || opts.ncsAppkey !== void 0 || opts.apigatewayAppkey !== void 0;
|
|
2248
|
+
).option("--iaas-region <region>", "iaas region (\uAE30\uBCF8: kr1)", "kr1").option("--ncr-appkey <key>", "ncr appkey (\uBE44\uB300\uD654\uD615)").option("--ncs-appkey <key>", "ncs appkey (\uBE44\uB300\uD654\uD615)").option("--apigateway-appkey <key>", "API Gateway appkey (\uBE44\uB300\uD654\uD615)").option("--deploy-appkey <key>", "deploy appkey (\uBE44\uB300\uD654\uD615)").option("--no-verify", "\uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC0DD\uB7B5").action(async (opts) => {
|
|
2249
|
+
const hasFlag = opts.uakId !== void 0 || opts.uakSecret !== void 0 || opts.logncrashAppkey !== void 0 || opts.logncrashSecret !== void 0 || opts.iaasTenantId !== void 0 || opts.iaasUsername !== void 0 || opts.iaasPassword !== void 0 || opts.ncrAppkey !== void 0 || opts.ncsAppkey !== void 0 || opts.apigatewayAppkey !== void 0 || opts.deployAppkey !== void 0;
|
|
2215
2250
|
try {
|
|
2216
2251
|
if (hasFlag) {
|
|
2217
2252
|
await runNonInteractive(opts);
|
|
@@ -2220,7 +2255,7 @@ var configureCommand = new import_commander.Command("configure").description("\u
|
|
|
2220
2255
|
}
|
|
2221
2256
|
} catch (err) {
|
|
2222
2257
|
if (err instanceof import_core.ExitPromptError) {
|
|
2223
|
-
process.stderr.write(
|
|
2258
|
+
process.stderr.write(import_chalk2.default.yellow("\n\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
2224
2259
|
return;
|
|
2225
2260
|
}
|
|
2226
2261
|
throw err;
|
|
@@ -3075,7 +3110,7 @@ var skillsCommand = createSkillsCommand();
|
|
|
3075
3110
|
|
|
3076
3111
|
// src/commands/doctor.ts
|
|
3077
3112
|
var import_commander3 = require("commander");
|
|
3078
|
-
var
|
|
3113
|
+
var import_chalk3 = __toESM(require("chalk"));
|
|
3079
3114
|
var import_promises4 = require("fs/promises");
|
|
3080
3115
|
var import_node_os4 = require("os");
|
|
3081
3116
|
var import_node_path6 = __toESM(require("path"));
|
|
@@ -3106,40 +3141,40 @@ async function readDefaultProfile() {
|
|
|
3106
3141
|
}
|
|
3107
3142
|
}
|
|
3108
3143
|
var doctorCommand = new import_commander3.Command("doctor").description("\uC790\uACA9\uC99D\uBA85\xB7\uC2A4\uD0AC \uC124\uCE58 \uC0C1\uD0DC\uB97C \uC9C4\uB2E8\uD55C\uB2E4(\uC624\uD504\uB77C\uC778 \u2014 \uC5F0\uACB0 \uD14C\uC2A4\uD2B8\uB294 configure \uB85C)").action(async () => {
|
|
3109
|
-
console.log(
|
|
3144
|
+
console.log(import_chalk3.default.bold("\n\u{1F50D} nhncloud-cli \uC9C4\uB2E8\n"));
|
|
3110
3145
|
const creds = await readProfiles();
|
|
3111
3146
|
const defaultProfile = await readDefaultProfile();
|
|
3112
|
-
console.log(
|
|
3147
|
+
console.log(import_chalk3.default.bold("\uC790\uACA9\uC99D\uBA85"));
|
|
3113
3148
|
if (creds.missing) {
|
|
3114
|
-
console.log(` ${
|
|
3149
|
+
console.log(` ${import_chalk3.default.red("\u274C \uBBF8\uC124\uC815")} \u2014 ${CREDENTIALS_PATH2} \uC5C6\uC74C. nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
3115
3150
|
} else if (creds.parseError) {
|
|
3116
|
-
console.log(` ${
|
|
3151
|
+
console.log(` ${import_chalk3.default.red("\u274C \uD30C\uC2F1 \uC624\uB958")} \u2014 ${CREDENTIALS_PATH2} \uAC00 \uC62C\uBC14\uB978 JSON \uC778\uC9C0 \uD655\uC778\uD558\uC138\uC694.`);
|
|
3117
3152
|
} else if (creds.profiles.length === 0) {
|
|
3118
|
-
console.log(` ${
|
|
3153
|
+
console.log(` ${import_chalk3.default.yellow("\u26A0 profile \uC5C6\uC74C")} \u2014 nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
3119
3154
|
} else {
|
|
3120
|
-
console.log(` ${
|
|
3121
|
-
console.log(` \uAE30\uBCF8 profile: ${defaultProfile ?
|
|
3155
|
+
console.log(` ${import_chalk3.default.green("\u2713 \uC124\uC815\uB428")} \u2014 profile: ${creds.profiles.join(", ")}`);
|
|
3156
|
+
console.log(` \uAE30\uBCF8 profile: ${defaultProfile ? import_chalk3.default.green(defaultProfile) : import_chalk3.default.gray("\uBBF8\uC9C0\uC815 (default \uC0AC\uC6A9)")}`);
|
|
3122
3157
|
}
|
|
3123
|
-
console.log(
|
|
3158
|
+
console.log(import_chalk3.default.bold("\nClaude Code \uC2A4\uD0AC"));
|
|
3124
3159
|
const skillStatus = await inspectSkill(createSkillManagerContext());
|
|
3125
3160
|
if (skillStatus.status === "current") {
|
|
3126
3161
|
console.log(
|
|
3127
|
-
` ${SKILL_NAME4}: ${
|
|
3162
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.green(`\u2713 current (${skillStatus.installedVersion ?? skillStatus.currentVersion})`)}`
|
|
3128
3163
|
);
|
|
3129
3164
|
} else if (skillStatus.status === "missing") {
|
|
3130
3165
|
console.log(
|
|
3131
|
-
` ${SKILL_NAME4}: ${
|
|
3166
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.gray(`\uBBF8\uC124\uCE58 \u2014 ${skillRecoveryCommand(skillStatus.status)}`)}`
|
|
3132
3167
|
);
|
|
3133
3168
|
} else {
|
|
3134
3169
|
console.log(
|
|
3135
|
-
` ${SKILL_NAME4}: ${
|
|
3170
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.yellow(`\u26A0 ${skillStatus.status}`)} \u2014 ${skillRecoveryCommand(skillStatus.status)}`
|
|
3136
3171
|
);
|
|
3137
3172
|
}
|
|
3138
3173
|
console.log();
|
|
3139
3174
|
if (!creds.missing && !creds.parseError && creds.profiles.length > 0) {
|
|
3140
|
-
console.log(
|
|
3175
|
+
console.log(import_chalk3.default.green("\u2713 \uAE30\uBCF8 \uC124\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
3141
3176
|
} else {
|
|
3142
|
-
console.log(
|
|
3177
|
+
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4: nhncloud configure"));
|
|
3143
3178
|
}
|
|
3144
3179
|
console.log();
|
|
3145
3180
|
});
|
|
@@ -3910,17 +3945,39 @@ async function createDeployClient(profileOpt) {
|
|
|
3910
3945
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
3911
3946
|
return { client: new DeployClient(accessToken), profileName };
|
|
3912
3947
|
}
|
|
3948
|
+
async function resolveDeployAppKey(profileName) {
|
|
3949
|
+
let cred;
|
|
3950
|
+
try {
|
|
3951
|
+
cred = await getServiceCredential("deploy", profileName);
|
|
3952
|
+
} catch (err) {
|
|
3953
|
+
if (!(err instanceof NhnCloudCliError) || err.exitCode !== EXIT_CONFIG_ERROR) {
|
|
3954
|
+
throw err;
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
if (!cred?.appkey) {
|
|
3958
|
+
throw new NhnCloudCliError(
|
|
3959
|
+
"Deploy appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.\nnhncloud configure --deploy-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694.",
|
|
3960
|
+
EXIT_CONFIG_ERROR
|
|
3961
|
+
);
|
|
3962
|
+
}
|
|
3963
|
+
return cred.appkey;
|
|
3964
|
+
}
|
|
3965
|
+
function requireCoordinate(value, flag) {
|
|
3966
|
+
if (!value) {
|
|
3967
|
+
throw new NhnCloudCliError(`${flag} \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
3968
|
+
}
|
|
3969
|
+
return value;
|
|
3970
|
+
}
|
|
3913
3971
|
|
|
3914
3972
|
// src/commands/deploy/run.ts
|
|
3915
|
-
var runCommand = new import_commander7.Command("run").description("\uBC30\uD3EC\uB97C \uC2E4\uD589\uD55C\uB2E4").
|
|
3973
|
+
var runCommand = new import_commander7.Command("run").description("\uBC30\uD3EC\uB97C \uC2E4\uD589\uD55C\uB2E4").option("--artifact-id <id>", "\uBC30\uD3EC\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--server-group-id <id>", "\uBC30\uD3EC \uB300\uC0C1 \uC11C\uBC84\uADF8\uB8F9 ID (server-groups \uB85C \uD655\uC778)").option("--scenario-ids <csv>", "\uC2E4\uD589\uD560 \uC2DC\uB098\uB9AC\uC624 ID \uBAA9\uB85D (\uC27C\uD45C \uAD6C\uBD84)").option("--target-hosts <csv>", "\uB300\uC0C1 \uD638\uC2A4\uD2B8 (\uC0DD\uB7B5 \uC2DC \uC11C\uBC84\uADF8\uB8F9 \uC804\uCCB4)").option("--concurrent <n>", "\uBCD1\uB82C \uBC30\uD3EC \uC218 (\uAE30\uBCF8 1)", "1").option("--next-when-fail", "\uC2DC\uB098\uB9AC\uC624 \uC2E4\uD328 \uC2DC\uC5D0\uB3C4 \uC9C4\uD589").option("--note <s>", "\uBC30\uD3EC \uBA54\uBAA8").option("--async", "\uC989\uC2DC \uBC18\uD658 (\uAE30\uBCF8\uC740 \uC644\uB8CC \uB300\uAE30)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3916
3974
|
const opts = cmd.optsWithGlobals();
|
|
3917
3975
|
const concurrentNum = parsePositiveIntegerOption(opts.concurrent ?? "1", "--concurrent");
|
|
3918
|
-
const
|
|
3919
|
-
const
|
|
3920
|
-
const
|
|
3921
|
-
const
|
|
3922
|
-
const
|
|
3923
|
-
const { client } = await createDeployClient(opts.profile);
|
|
3976
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
3977
|
+
const serverGroupId = requireCoordinate(opts.serverGroupId, "--server-group-id");
|
|
3978
|
+
const scenarioIds = requireCoordinate(opts.scenarioIds, "--scenario-ids");
|
|
3979
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
3980
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
3924
3981
|
startSpinner("\uBC30\uD3EC \uC2E4\uD589 \uC911...");
|
|
3925
3982
|
let result;
|
|
3926
3983
|
try {
|
|
@@ -3950,21 +4007,10 @@ var runCommand = new import_commander7.Command("run").description("\uBC30\uD3EC\
|
|
|
3950
4007
|
|
|
3951
4008
|
// src/commands/deploy/artifacts.ts
|
|
3952
4009
|
var import_commander8 = require("commander");
|
|
3953
|
-
var artifactsCommand = new import_commander8.Command("artifacts").description("\uC544\uD2F0\uD329\uD2B8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").
|
|
4010
|
+
var artifactsCommand = new import_commander8.Command("artifacts").description("\uC544\uD2F0\uD329\uD2B8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3954
4011
|
const opts = cmd.optsWithGlobals();
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
appKey = opts.appKey;
|
|
3958
|
-
} else if (targetName) {
|
|
3959
|
-
const target = await getDeployTarget(targetName);
|
|
3960
|
-
appKey = target.appKey;
|
|
3961
|
-
} else {
|
|
3962
|
-
throw new NhnCloudCliError(
|
|
3963
|
-
"target \uC774\uB984 \uB610\uB294 --app-key \uC635\uC158\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \uC608: deploy artifacts <target> \uB610\uB294 deploy artifacts --app-key <appKey>",
|
|
3964
|
-
EXIT_PARAM_ERROR
|
|
3965
|
-
);
|
|
3966
|
-
}
|
|
3967
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4012
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4013
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
3968
4014
|
startSpinner("\uC544\uD2F0\uD329\uD2B8 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
3969
4015
|
let result;
|
|
3970
4016
|
try {
|
|
@@ -3991,12 +4037,11 @@ var artifactsCommand = new import_commander8.Command("artifacts").description("\
|
|
|
3991
4037
|
|
|
3992
4038
|
// src/commands/deploy/server-groups.ts
|
|
3993
4039
|
var import_commander9 = require("commander");
|
|
3994
|
-
var serverGroupsCommand = new import_commander9.Command("server-groups").description("\uC11C\uBC84\uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").
|
|
4040
|
+
var serverGroupsCommand = new import_commander9.Command("server-groups").description("\uC11C\uBC84\uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3995
4041
|
const opts = cmd.optsWithGlobals();
|
|
3996
|
-
const
|
|
3997
|
-
const
|
|
3998
|
-
const
|
|
3999
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4042
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4043
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4044
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4000
4045
|
startSpinner("\uC11C\uBC84\uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4001
4046
|
let result;
|
|
4002
4047
|
try {
|
|
@@ -4016,12 +4061,11 @@ var serverGroupsCommand = new import_commander9.Command("server-groups").descrip
|
|
|
4016
4061
|
|
|
4017
4062
|
// src/commands/deploy/histories.ts
|
|
4018
4063
|
var import_commander10 = require("commander");
|
|
4019
|
-
var historiesCommand = new import_commander10.Command("histories").description("\uBC30\uD3EC \uC774\uB825\uC744 \uC870\uD68C\uD55C\uB2E4").
|
|
4064
|
+
var historiesCommand = new import_commander10.Command("histories").description("\uBC30\uD3EC \uC774\uB825\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4020
4065
|
const opts = cmd.optsWithGlobals();
|
|
4021
|
-
const
|
|
4022
|
-
const
|
|
4023
|
-
const
|
|
4024
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4066
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4067
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4068
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4025
4069
|
startSpinner("\uBC30\uD3EC \uC774\uB825 \uC870\uD68C \uC911...");
|
|
4026
4070
|
let result;
|
|
4027
4071
|
try {
|
|
@@ -4041,12 +4085,11 @@ var historiesCommand = new import_commander10.Command("histories").description("
|
|
|
4041
4085
|
|
|
4042
4086
|
// src/commands/deploy/binary-groups.ts
|
|
4043
4087
|
var import_commander11 = require("commander");
|
|
4044
|
-
var binaryGroupsCommand = new import_commander11.Command("binary-groups").description("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").
|
|
4088
|
+
var binaryGroupsCommand = new import_commander11.Command("binary-groups").description("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4045
4089
|
const opts = cmd.optsWithGlobals();
|
|
4046
|
-
const
|
|
4047
|
-
const
|
|
4048
|
-
const
|
|
4049
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4090
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4091
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4092
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4050
4093
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4051
4094
|
let groups;
|
|
4052
4095
|
try {
|
|
@@ -4084,7 +4127,7 @@ function parsePositiveInt(value, flag) {
|
|
|
4084
4127
|
}
|
|
4085
4128
|
return Number(value);
|
|
4086
4129
|
}
|
|
4087
|
-
var binariesCommand = new import_commander12.Command("binaries").description("\uD2B9\uC815 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC758 \uBC14\uC774\uB108\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").
|
|
4130
|
+
var binariesCommand = new import_commander12.Command("binaries").description("\uD2B9\uC815 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC758 \uBC14\uC774\uB108\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").requiredOption("--binary-group <key>", "\uC870\uD68C\uD560 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").option("--page-num <n>", "\uD398\uC774\uC9C0 \uBC88\uD638 (1 \uC774\uC0C1)").option("--page-size <n>", "\uD398\uC774\uC9C0 \uD06C\uAE30 (1 \uC774\uC0C1)").option("--sort-key <k>", "\uC815\uB82C \uAE30\uC900 (\uC608: UPLOAD_DATE)").option("--sort-direction <d>", "\uC815\uB82C \uBC29\uD5A5 (\uC608: DESC)").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4088
4131
|
const opts = cmd.optsWithGlobals();
|
|
4089
4132
|
const binaryGroupKey = parsePositiveInt(opts.binaryGroup, "--binary-group");
|
|
4090
4133
|
if (binaryGroupKey === void 0) {
|
|
@@ -4092,10 +4135,9 @@ var binariesCommand = new import_commander12.Command("binaries").description("\u
|
|
|
4092
4135
|
}
|
|
4093
4136
|
const pageNum = parsePositiveInt(opts.pageNum, "--page-num");
|
|
4094
4137
|
const pageSize = parsePositiveInt(opts.pageSize, "--page-size");
|
|
4095
|
-
const
|
|
4096
|
-
const
|
|
4097
|
-
const
|
|
4098
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4138
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4139
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4140
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4099
4141
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4100
4142
|
let result;
|
|
4101
4143
|
try {
|
|
@@ -4143,12 +4185,13 @@ function parsePositiveInt2(value, flag) {
|
|
|
4143
4185
|
}
|
|
4144
4186
|
return Number(value);
|
|
4145
4187
|
}
|
|
4146
|
-
var uploadCommand = new import_commander13.Command("upload").description("\uB85C\uCEEC \uD30C\uC77C\uC744 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC5D0 \uC5C5\uB85C\uB4DC\uD55C\uB2E4").
|
|
4188
|
+
var uploadCommand = new import_commander13.Command("upload").description("\uB85C\uCEEC \uD30C\uC77C\uC744 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC5D0 \uC5C5\uB85C\uB4DC\uD55C\uB2E4").requiredOption("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C").requiredOption("--binary-group <key>", "\uC5C5\uB85C\uB4DC \uB300\uC0C1 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").option("--application-type <type>", "applicationType (\uC608: server)", "server").option("--description <text>", "\uBC14\uC774\uB108\uB9AC \uC124\uBA85").option("--artifact-id <id>", "\uC5C5\uB85C\uB4DC \uB300\uC0C1 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4147
4189
|
const opts = cmd.optsWithGlobals();
|
|
4148
4190
|
const binaryGroupKey = parsePositiveInt2(opts.binaryGroup, "--binary-group");
|
|
4149
4191
|
if (binaryGroupKey === void 0) {
|
|
4150
4192
|
throw new NhnCloudCliError("--binary-group \uC774 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
4151
4193
|
}
|
|
4194
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4152
4195
|
const filePath = opts.file;
|
|
4153
4196
|
let stat3;
|
|
4154
4197
|
try {
|
|
@@ -4171,10 +4214,8 @@ var uploadCommand = new import_commander13.Command("upload").description("\uB85C
|
|
|
4171
4214
|
}
|
|
4172
4215
|
const fileBuffer = (0, import_node_fs5.readFileSync)(filePath);
|
|
4173
4216
|
const fileName = (0, import_node_path7.basename)(filePath);
|
|
4174
|
-
const
|
|
4175
|
-
const appKey =
|
|
4176
|
-
const artifactId = opts.artifactId ?? target.artifactId;
|
|
4177
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4217
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4218
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4178
4219
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uC5C5\uB85C\uB4DC \uC911...");
|
|
4179
4220
|
let result;
|
|
4180
4221
|
try {
|
|
@@ -4207,7 +4248,7 @@ var uploadCommand = new import_commander13.Command("upload").description("\uB85C
|
|
|
4207
4248
|
// src/commands/deploy/download.ts
|
|
4208
4249
|
var import_commander14 = require("commander");
|
|
4209
4250
|
var import_node_fs6 = require("fs");
|
|
4210
|
-
var
|
|
4251
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
4211
4252
|
function parsePositiveInt3(value, flag) {
|
|
4212
4253
|
if (value === void 0) return void 0;
|
|
4213
4254
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -4235,19 +4276,18 @@ function assertWritable2(path5, force) {
|
|
|
4235
4276
|
EXIT_PARAM_ERROR
|
|
4236
4277
|
);
|
|
4237
4278
|
}
|
|
4238
|
-
var downloadCommand = new import_commander14.Command("download").description("\uBC14\uC774\uB108\uB9AC\uB97C \uB85C\uCEEC \uD30C\uC77C\uB85C \uB2E4\uC6B4\uB85C\uB4DC\uD55C\uB2E4").
|
|
4279
|
+
var downloadCommand = new import_commander14.Command("download").description("\uBC14\uC774\uB108\uB9AC\uB97C \uB85C\uCEEC \uD30C\uC77C\uB85C \uB2E4\uC6B4\uB85C\uB4DC\uD55C\uB2E4").requiredOption("--binary-group <key>", "\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").requiredOption("--binary-key <key>", "\uB2E4\uC6B4\uB85C\uB4DC\uD560 \uBC14\uC774\uB108\uB9AC key (binaries \uB610\uB294 upload \uB85C \uD655\uC778)").requiredOption("-o, --output <file>", "\uC800\uC7A5\uD560 \uD30C\uC77C \uACBD\uB85C").option("--force", "\uB300\uC0C1 \uD30C\uC77C\uC774 \uC788\uC73C\uBA74 \uB36E\uC5B4\uC4F4\uB2E4").option("--artifact-id <id>", "\uB300\uC0C1 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4239
4280
|
const opts = cmd.optsWithGlobals();
|
|
4240
4281
|
const binaryGroupKey = parsePositiveInt3(opts.binaryGroup, "--binary-group");
|
|
4241
4282
|
const binaryKey = parsePositiveInt3(opts.binaryKey, "--binary-key");
|
|
4242
4283
|
if (binaryGroupKey === void 0 || binaryKey === void 0) {
|
|
4243
4284
|
throw new NhnCloudCliError("--binary-group / --binary-key \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
4244
4285
|
}
|
|
4286
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4245
4287
|
const outPath = opts.output;
|
|
4246
4288
|
assertWritable2(outPath, opts.force ?? false);
|
|
4247
|
-
const
|
|
4248
|
-
const appKey =
|
|
4249
|
-
const artifactId = opts.artifactId ?? target.artifactId;
|
|
4250
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4289
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4290
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4251
4291
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
4252
4292
|
try {
|
|
4253
4293
|
const buffer = await client.downloadBinary(appKey, artifactId, binaryGroupKey, binaryKey);
|
|
@@ -4258,7 +4298,7 @@ var downloadCommand = new import_commander14.Command("download").description("\u
|
|
|
4258
4298
|
}
|
|
4259
4299
|
stopSpinner(true);
|
|
4260
4300
|
if (!opts.quiet) {
|
|
4261
|
-
process.stderr.write(
|
|
4301
|
+
process.stderr.write(import_chalk4.default.green(` \uC800\uC7A5\uB428: ${outPath}
|
|
4262
4302
|
`));
|
|
4263
4303
|
}
|
|
4264
4304
|
});
|
|
@@ -5035,7 +5075,7 @@ var getCommand = new import_commander17.Command("get").description("\uB2E8\uC77C
|
|
|
5035
5075
|
|
|
5036
5076
|
// src/commands/volume/create.ts
|
|
5037
5077
|
var import_commander18 = require("commander");
|
|
5038
|
-
var
|
|
5078
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
5039
5079
|
var createCommand = new import_commander18.Command("create").description("\uBCFC\uB968\uC744 \uBC1C\uAE09\uD55C\uB2E4").requiredOption("--size <gb>", "\uBCFC\uB968 \uD06C\uAE30(GB) \u2014 \uD544\uC218").option("--name <name>", "\uBCFC\uB968 \uC774\uB984").option("--description <text>", "\uBCFC\uB968 \uC124\uBA85").option("--volume-type <type>", "\uBCFC\uB968 \uD0C0\uC785").option("--availability-zone <az>", "\uAC00\uC6A9\uC131 \uC601\uC5ED(AZ). instance availability-zones \uB85C \uC870\uD68C\uD55C zoneName \uC9C0\uC815").option("--snapshot-id <id>", "\uC2A4\uB0C5\uC0F7 ID (\uC2A4\uB0C5\uC0F7\uC5D0\uC11C \uBCFC\uB968 \uC0DD\uC131)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5040
5080
|
const opts = cmd.optsWithGlobals();
|
|
5041
5081
|
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
@@ -5069,7 +5109,7 @@ var createCommand = new import_commander18.Command("create").description("\uBCFC
|
|
|
5069
5109
|
throw err;
|
|
5070
5110
|
}
|
|
5071
5111
|
stopSpinner(true);
|
|
5072
|
-
process.stderr.write(
|
|
5112
|
+
process.stderr.write(import_chalk5.default.green(`\uBCFC\uB968 \uBC1C\uAE09 \uC694\uCCAD \uC644\uB8CC (id: ${volume.id}, status: ${volume.status})
|
|
5073
5113
|
`));
|
|
5074
5114
|
const rows = [
|
|
5075
5115
|
["id", volume.id],
|
|
@@ -5347,7 +5387,7 @@ var listCommand4 = new import_commander21.Command("list").description("Floating
|
|
|
5347
5387
|
|
|
5348
5388
|
// src/commands/floatingip/create.ts
|
|
5349
5389
|
var import_commander22 = require("commander");
|
|
5350
|
-
var
|
|
5390
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
5351
5391
|
var createCommand2 = new import_commander22.Command("create").description("Floating IP \uB97C \uBC1C\uAE09\uD55C\uB2E4 (--network \uBBF8\uC9C0\uC815 \uC2DC \uC678\uBD80 VPC \uC790\uB3D9 \uC870\uD68C)").option("--network <id>", "\uC678\uBD80 \uB124\uD2B8\uC6CC\uD06C(VPC) id (\uBBF8\uC9C0\uC815 \uC2DC router:external=true \uC790\uB3D9 \uC870\uD68C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5352
5392
|
const opts = cmd.optsWithGlobals();
|
|
5353
5393
|
const { client } = await resolveNetworkClient(opts);
|
|
@@ -5379,7 +5419,7 @@ var createCommand2 = new import_commander22.Command("create").description("Float
|
|
|
5379
5419
|
}
|
|
5380
5420
|
stopSpinner(true);
|
|
5381
5421
|
process.stderr.write(
|
|
5382
|
-
|
|
5422
|
+
import_chalk6.default.green(`\u2713 Floating IP "${fip.floating_ip_address}" \uB97C \uBC1C\uAE09\uD588\uC2B5\uB2C8\uB2E4 (id: ${fip.id}).
|
|
5383
5423
|
`)
|
|
5384
5424
|
);
|
|
5385
5425
|
output(opts, {
|
|
@@ -5392,7 +5432,7 @@ var createCommand2 = new import_commander22.Command("create").description("Float
|
|
|
5392
5432
|
|
|
5393
5433
|
// src/commands/floatingip/delete.ts
|
|
5394
5434
|
var import_commander23 = require("commander");
|
|
5395
|
-
var
|
|
5435
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
5396
5436
|
var deleteCommand = new import_commander23.Command("delete").description("Floating IP \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "Floating IP ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
5397
5437
|
const opts = cmd.optsWithGlobals();
|
|
5398
5438
|
const isTTY = process.stdin.isTTY;
|
|
@@ -5409,7 +5449,7 @@ var deleteCommand = new import_commander23.Command("delete").description("Floati
|
|
|
5409
5449
|
default: false
|
|
5410
5450
|
});
|
|
5411
5451
|
if (!ok) {
|
|
5412
|
-
process.stderr.write(
|
|
5452
|
+
process.stderr.write(import_chalk7.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
5413
5453
|
return;
|
|
5414
5454
|
}
|
|
5415
5455
|
}
|
|
@@ -5422,7 +5462,7 @@ var deleteCommand = new import_commander23.Command("delete").description("Floati
|
|
|
5422
5462
|
throw err;
|
|
5423
5463
|
}
|
|
5424
5464
|
stopSpinner(true);
|
|
5425
|
-
process.stderr.write(
|
|
5465
|
+
process.stderr.write(import_chalk7.default.green(`\u2713 Floating IP "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5426
5466
|
`));
|
|
5427
5467
|
});
|
|
5428
5468
|
|
|
@@ -5534,7 +5574,7 @@ var getCommand2 = new import_commander26.Command("get").description("\uB2E8\uC77
|
|
|
5534
5574
|
// src/commands/instance/create.ts
|
|
5535
5575
|
var import_commander27 = require("commander");
|
|
5536
5576
|
var import_node_fs7 = require("fs");
|
|
5537
|
-
var
|
|
5577
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
5538
5578
|
function getFirstIp(server) {
|
|
5539
5579
|
for (const list of Object.values(server.addresses)) {
|
|
5540
5580
|
for (const addr of list) {
|
|
@@ -5628,7 +5668,7 @@ var createCommand3 = new import_commander27.Command("create").description("\uC77
|
|
|
5628
5668
|
return;
|
|
5629
5669
|
}
|
|
5630
5670
|
if (opts.wait) {
|
|
5631
|
-
process.stderr.write(
|
|
5671
|
+
process.stderr.write(import_chalk8.default.green(` IP: ${getIps3(server)}
|
|
5632
5672
|
`));
|
|
5633
5673
|
}
|
|
5634
5674
|
const rows = [
|
|
@@ -5649,7 +5689,7 @@ var createCommand3 = new import_commander27.Command("create").description("\uC77
|
|
|
5649
5689
|
|
|
5650
5690
|
// src/commands/instance/delete.ts
|
|
5651
5691
|
var import_commander28 = require("commander");
|
|
5652
|
-
var
|
|
5692
|
+
var import_chalk9 = __toESM(require("chalk"));
|
|
5653
5693
|
var deleteCommand2 = new import_commander28.Command("delete").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
5654
5694
|
const opts = cmd.optsWithGlobals();
|
|
5655
5695
|
const isTTY = process.stdin.isTTY;
|
|
@@ -5666,7 +5706,7 @@ var deleteCommand2 = new import_commander28.Command("delete").description("\uC77
|
|
|
5666
5706
|
default: false
|
|
5667
5707
|
});
|
|
5668
5708
|
if (!ok) {
|
|
5669
|
-
process.stderr.write(
|
|
5709
|
+
process.stderr.write(import_chalk9.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
5670
5710
|
return;
|
|
5671
5711
|
}
|
|
5672
5712
|
}
|
|
@@ -5679,13 +5719,13 @@ var deleteCommand2 = new import_commander28.Command("delete").description("\uC77
|
|
|
5679
5719
|
throw err;
|
|
5680
5720
|
}
|
|
5681
5721
|
stopSpinner(true);
|
|
5682
|
-
process.stderr.write(
|
|
5722
|
+
process.stderr.write(import_chalk9.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5683
5723
|
`));
|
|
5684
5724
|
});
|
|
5685
5725
|
|
|
5686
5726
|
// src/commands/instance/power.ts
|
|
5687
5727
|
var import_commander29 = require("commander");
|
|
5688
|
-
var
|
|
5728
|
+
var import_chalk10 = __toESM(require("chalk"));
|
|
5689
5729
|
var startCommand = new import_commander29.Command("start").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC2DC\uC791\uD55C\uB2E4 (SHUTOFF \u2192 ACTIVE)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
5690
5730
|
const opts = cmd.optsWithGlobals();
|
|
5691
5731
|
const { client } = await resolveInstanceClient(opts);
|
|
@@ -5697,7 +5737,7 @@ var startCommand = new import_commander29.Command("start").description("\uC778\u
|
|
|
5697
5737
|
throw err;
|
|
5698
5738
|
}
|
|
5699
5739
|
stopSpinner(true);
|
|
5700
|
-
process.stderr.write(
|
|
5740
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC2DC\uC791\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 ACTIVE).
|
|
5701
5741
|
`));
|
|
5702
5742
|
});
|
|
5703
5743
|
var stopCommand = new import_commander29.Command("stop").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC815\uC9C0\uD55C\uB2E4 (ACTIVE/ERROR \u2192 SHUTOFF)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
@@ -5711,7 +5751,7 @@ var stopCommand = new import_commander29.Command("stop").description("\uC778\uC2
|
|
|
5711
5751
|
throw err;
|
|
5712
5752
|
}
|
|
5713
5753
|
stopSpinner(true);
|
|
5714
|
-
process.stderr.write(
|
|
5754
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC815\uC9C0\uB97C \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 SHUTOFF).
|
|
5715
5755
|
`));
|
|
5716
5756
|
});
|
|
5717
5757
|
var rebootCommand = new import_commander29.Command("reboot").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC7AC\uBD80\uD305\uD55C\uB2E4 (\uAE30\uBCF8 SOFT, --hard \uB85C HARD)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--hard", "HARD \uC7AC\uBD80\uD305 (\uAC15\uC81C \uC804\uC6D0 cycle, \uAE30\uBCF8\uC740 SOFT)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
@@ -5726,13 +5766,13 @@ var rebootCommand = new import_commander29.Command("reboot").description("\uC778
|
|
|
5726
5766
|
throw err;
|
|
5727
5767
|
}
|
|
5728
5768
|
stopSpinner(true);
|
|
5729
|
-
process.stderr.write(
|
|
5769
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" ${type} \uC7AC\uBD80\uD305\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4.
|
|
5730
5770
|
`));
|
|
5731
5771
|
});
|
|
5732
5772
|
|
|
5733
5773
|
// src/commands/instance/resize.ts
|
|
5734
5774
|
var import_commander30 = require("commander");
|
|
5735
|
-
var
|
|
5775
|
+
var import_chalk11 = __toESM(require("chalk"));
|
|
5736
5776
|
var resizeCommand = new import_commander30.Command("resize").description("\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785(flavor)\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").requiredOption("--flavor <id>", "\uBCC0\uACBD\uD560 flavor ID (instance flavors \uB85C \uD6C4\uBCF4 \uC870\uD68C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
5737
5777
|
const opts = cmd.optsWithGlobals();
|
|
5738
5778
|
const { client } = await resolveInstanceClient(opts);
|
|
@@ -5745,7 +5785,7 @@ var resizeCommand = new import_commander30.Command("resize").description("\uC778
|
|
|
5745
5785
|
}
|
|
5746
5786
|
stopSpinner(true);
|
|
5747
5787
|
process.stderr.write(
|
|
5748
|
-
|
|
5788
|
+
import_chalk11.default.green(
|
|
5749
5789
|
`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uD0C0\uC785 \uBCC0\uACBD(flavor: ${opts.flavor}) \uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 VERIFY_RESIZE, instance get \uC73C\uB85C \uD655\uC778 \uD6C4 resize-confirm/resize-revert).
|
|
5750
5790
|
`
|
|
5751
5791
|
)
|
|
@@ -5762,7 +5802,7 @@ var resizeConfirmCommand = new import_commander30.Command("resize-confirm").desc
|
|
|
5762
5802
|
throw err;
|
|
5763
5803
|
}
|
|
5764
5804
|
stopSpinner(true);
|
|
5765
|
-
process.stderr.write(
|
|
5805
|
+
process.stderr.write(import_chalk11.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" resize \uD655\uC815\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 ACTIVE).
|
|
5766
5806
|
`));
|
|
5767
5807
|
});
|
|
5768
5808
|
var resizeRevertCommand = new import_commander30.Command("resize-revert").description("resize \uB97C \uB864\uBC31\uD55C\uB2E4 (VERIFY_RESIZE \u2192 ACTIVE, \uC774\uC804 flavor \uB85C \uBCF5\uADC0)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
@@ -5777,7 +5817,7 @@ var resizeRevertCommand = new import_commander30.Command("resize-revert").descri
|
|
|
5777
5817
|
}
|
|
5778
5818
|
stopSpinner(true);
|
|
5779
5819
|
process.stderr.write(
|
|
5780
|
-
|
|
5820
|
+
import_chalk11.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" resize \uB864\uBC31\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\uC774\uC804 flavor \uB85C \uBCF5\uADC0).
|
|
5781
5821
|
`)
|
|
5782
5822
|
);
|
|
5783
5823
|
});
|
|
@@ -5858,7 +5898,7 @@ var keypairsCommand = new import_commander32.Command("keypairs").description("\u
|
|
|
5858
5898
|
var import_commander33 = require("commander");
|
|
5859
5899
|
var import_node_fs8 = require("fs");
|
|
5860
5900
|
var import_node_crypto5 = require("crypto");
|
|
5861
|
-
var
|
|
5901
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
5862
5902
|
function resolvePublicKey(value) {
|
|
5863
5903
|
let stat3;
|
|
5864
5904
|
try {
|
|
@@ -5952,19 +5992,19 @@ var createKeypairCmd = new import_commander33.Command("create").description("\uD
|
|
|
5952
5992
|
if (opts.output !== void 0) {
|
|
5953
5993
|
try {
|
|
5954
5994
|
savePrivateKey(opts.output, result.private_key);
|
|
5955
|
-
process.stderr.write(
|
|
5995
|
+
process.stderr.write(import_chalk12.default.green(` private_key \uB97C ${opts.output} \uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4 (mode 0600).
|
|
5956
5996
|
`));
|
|
5957
5997
|
} catch (saveErr) {
|
|
5958
5998
|
const reason = saveErr instanceof Error ? saveErr.message : String(saveErr);
|
|
5959
5999
|
process.stderr.write(
|
|
5960
|
-
|
|
6000
|
+
import_chalk12.default.red(` \u26A0 private_key \uD30C\uC77C \uC800\uC7A5 \uC2E4\uD328 (${reason}). \uC720\uC2E4 \uBC29\uC9C0\uB97C \uC704\uD574 \uC544\uB798\uC5D0 \uCD9C\uB825\uD569\uB2C8\uB2E4 \u2014 \uC989\uC2DC \uC548\uC804\uD55C \uACF3\uC5D0 \uBCF4\uAD00\uD558\uC138\uC694.
|
|
5961
6001
|
`)
|
|
5962
6002
|
);
|
|
5963
6003
|
process.stdout.write(result.private_key + "\n");
|
|
5964
6004
|
}
|
|
5965
6005
|
} else {
|
|
5966
6006
|
process.stderr.write(
|
|
5967
|
-
|
|
6007
|
+
import_chalk12.default.yellow(" \u26A0 private_key \uB294 \uC9C0\uAE08 \uD55C \uBC88\uB9CC \uD45C\uC2DC\uB429\uB2C8\uB2E4. \uBD84\uC2E4 \uC2DC \uBCF5\uAD6C \uBD88\uAC00 \u2014 \uC548\uC804\uD55C \uACF3\uC5D0 \uBCF4\uAD00\uD558\uC138\uC694.\n")
|
|
5968
6008
|
);
|
|
5969
6009
|
process.stdout.write(result.private_key + "\n");
|
|
5970
6010
|
}
|
|
@@ -5993,14 +6033,14 @@ var deleteKeypairCmd = new import_commander33.Command("delete").description("\uD
|
|
|
5993
6033
|
throw err;
|
|
5994
6034
|
}
|
|
5995
6035
|
stopSpinner(true);
|
|
5996
|
-
process.stderr.write(
|
|
6036
|
+
process.stderr.write(import_chalk12.default.green(`\u2713 \uD0A4\uD398\uC5B4 "${name}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5997
6037
|
`));
|
|
5998
6038
|
});
|
|
5999
6039
|
var keypairCommand = new import_commander33.Command("keypair").description("\uD0A4\uD398\uC5B4 \uB2E8\uAC74 \uAD00\uB9AC (get / create / delete)").addCommand(getKeypairCmd).addCommand(createKeypairCmd).addCommand(deleteKeypairCmd);
|
|
6000
6040
|
|
|
6001
6041
|
// src/commands/instance/volume.ts
|
|
6002
6042
|
var import_commander34 = require("commander");
|
|
6003
|
-
var
|
|
6043
|
+
var import_chalk13 = __toESM(require("chalk"));
|
|
6004
6044
|
var attachCommand = new import_commander34.Command("attach").description("\uBCFC\uB968\uC744 \uC778\uC2A4\uD134\uC2A4\uC5D0 \uC5F0\uACB0\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").requiredOption("--volume <volumeId>", "\uC5F0\uACB0\uD560 \uBCFC\uB968 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
6005
6045
|
const opts = cmd.optsWithGlobals();
|
|
6006
6046
|
const { client } = await resolveInstanceClient(opts);
|
|
@@ -6014,7 +6054,7 @@ var attachCommand = new import_commander34.Command("attach").description("\uBCFC
|
|
|
6014
6054
|
}
|
|
6015
6055
|
stopSpinner(true);
|
|
6016
6056
|
process.stderr.write(
|
|
6017
|
-
|
|
6057
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uC644\uB8CC (volumeId: ${att.volumeId}, device: ${att.device})
|
|
6018
6058
|
`)
|
|
6019
6059
|
);
|
|
6020
6060
|
output(opts, {
|
|
@@ -6041,7 +6081,7 @@ var detachCommand = new import_commander34.Command("detach").description("\uBCFC
|
|
|
6041
6081
|
}
|
|
6042
6082
|
stopSpinner(true);
|
|
6043
6083
|
process.stderr.write(
|
|
6044
|
-
|
|
6084
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC694\uCCAD \uC644\uB8CC (volumeId: ${volumeId})
|
|
6045
6085
|
`)
|
|
6046
6086
|
);
|
|
6047
6087
|
});
|
|
@@ -6166,8 +6206,7 @@ async function createNcrClient(opts) {
|
|
|
6166
6206
|
const region = opts.region ?? "kr1";
|
|
6167
6207
|
return { client: new NcrClient(uak.id, uak.secret, region), profileName };
|
|
6168
6208
|
}
|
|
6169
|
-
async function resolveAppKey(profileName
|
|
6170
|
-
if (appKeyOpt) return appKeyOpt;
|
|
6209
|
+
async function resolveAppKey(profileName) {
|
|
6171
6210
|
let cred;
|
|
6172
6211
|
try {
|
|
6173
6212
|
cred = await getServiceCredential("ncr", profileName);
|
|
@@ -6178,7 +6217,7 @@ async function resolveAppKey(profileName, appKeyOpt) {
|
|
|
6178
6217
|
}
|
|
6179
6218
|
if (!cred?.appkey) {
|
|
6180
6219
|
throw new NhnCloudCliError(
|
|
6181
|
-
"NCR appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4
|
|
6220
|
+
"NCR appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.\nnhncloud configure --ncr-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694.",
|
|
6182
6221
|
EXIT_CONFIG_ERROR
|
|
6183
6222
|
);
|
|
6184
6223
|
}
|
|
@@ -6186,7 +6225,7 @@ async function resolveAppKey(profileName, appKeyOpt) {
|
|
|
6186
6225
|
}
|
|
6187
6226
|
async function createHarborClient(opts, registryArg) {
|
|
6188
6227
|
const { client: ncrClient, profileName } = await createNcrClient(opts);
|
|
6189
|
-
const appKey = await resolveAppKey(profileName
|
|
6228
|
+
const appKey = await resolveAppKey(profileName);
|
|
6190
6229
|
const uak = await getUserAccessKey(profileName);
|
|
6191
6230
|
const reg = await ncrClient.getRegistry(appKey, registryArg);
|
|
6192
6231
|
const host = parseHarborHost(reg.uri);
|
|
@@ -6212,10 +6251,10 @@ function parseHarborHost(uri) {
|
|
|
6212
6251
|
}
|
|
6213
6252
|
|
|
6214
6253
|
// src/commands/ncr/list.ts
|
|
6215
|
-
var listCommand5 = new import_commander36.Command("list").description("NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--
|
|
6254
|
+
var listCommand5 = new import_commander36.Command("list").description("NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
6216
6255
|
const opts = cmd.optsWithGlobals();
|
|
6217
6256
|
const { client, profileName } = await createNcrClient(opts);
|
|
6218
|
-
const appKey = await resolveAppKey(profileName
|
|
6257
|
+
const appKey = await resolveAppKey(profileName);
|
|
6219
6258
|
startSpinner("\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
6220
6259
|
let registries;
|
|
6221
6260
|
try {
|
|
@@ -6239,7 +6278,7 @@ var listCommand5 = new import_commander36.Command("list").description("NCR \uB80
|
|
|
6239
6278
|
|
|
6240
6279
|
// src/commands/ncr/get.ts
|
|
6241
6280
|
var import_commander37 = require("commander");
|
|
6242
|
-
var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77C NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984 \uB610\uB294 ID").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--
|
|
6281
|
+
var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77C NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984 \uB610\uB294 ID").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
6243
6282
|
const opts = cmd.optsWithGlobals();
|
|
6244
6283
|
if (!registry.trim()) {
|
|
6245
6284
|
throw new NhnCloudCliError(
|
|
@@ -6248,7 +6287,7 @@ var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77
|
|
|
6248
6287
|
);
|
|
6249
6288
|
}
|
|
6250
6289
|
const { client, profileName } = await createNcrClient(opts);
|
|
6251
|
-
const appKey = await resolveAppKey(profileName
|
|
6290
|
+
const appKey = await resolveAppKey(profileName);
|
|
6252
6291
|
startSpinner(`\uB808\uC9C0\uC2A4\uD2B8\uB9AC "${registry}" \uC870\uD68C \uC911...`);
|
|
6253
6292
|
let reg;
|
|
6254
6293
|
try {
|
|
@@ -6268,7 +6307,7 @@ var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77
|
|
|
6268
6307
|
|
|
6269
6308
|
// src/commands/ncr/images.ts
|
|
6270
6309
|
var import_commander38 = require("commander");
|
|
6271
|
-
var imagesCommand2 = new import_commander38.Command("images").description("\uB808\uC9C0\uC2A4\uD2B8\uB9AC\uC758 \uC774\uBBF8\uC9C0(repository) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--
|
|
6310
|
+
var imagesCommand2 = new import_commander38.Command("images").description("\uB808\uC9C0\uC2A4\uD2B8\uB9AC\uC758 \uC774\uBBF8\uC9C0(repository) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
6272
6311
|
const opts = cmd.optsWithGlobals();
|
|
6273
6312
|
if (!registry.trim()) {
|
|
6274
6313
|
throw new NhnCloudCliError(
|
|
@@ -6303,7 +6342,7 @@ var imagesCommand2 = new import_commander38.Command("images").description("\uB80
|
|
|
6303
6342
|
|
|
6304
6343
|
// src/commands/ncr/tags.ts
|
|
6305
6344
|
var import_commander39 = require("commander");
|
|
6306
|
-
var tagsCommand = new import_commander39.Command("tags").description("\uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD0DC\uADF8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").argument("<repository>", "\uC774\uBBF8\uC9C0(repository) \uC774\uB984 (\uC9E7\uC740 \uC774\uB984 \uB610\uB294 {project}/{repo})").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--
|
|
6345
|
+
var tagsCommand = new import_commander39.Command("tags").description("\uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD0DC\uADF8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").argument("<repository>", "\uC774\uBBF8\uC9C0(repository) \uC774\uB984 (\uC9E7\uC740 \uC774\uB984 \uB610\uB294 {project}/{repo})").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, repository, _opts, cmd) => {
|
|
6307
6346
|
const opts = cmd.optsWithGlobals();
|
|
6308
6347
|
if (!registry.trim()) {
|
|
6309
6348
|
throw new NhnCloudCliError(
|
|
@@ -6998,7 +7037,7 @@ var supportsCommand = new import_commander41.Command("supports").description("NK
|
|
|
6998
7037
|
// src/commands/nks/cluster.ts
|
|
6999
7038
|
var import_promises7 = require("fs/promises");
|
|
7000
7039
|
var import_commander42 = require("commander");
|
|
7001
|
-
var
|
|
7040
|
+
var import_chalk14 = __toESM(require("chalk"));
|
|
7002
7041
|
var listCommand6 = new import_commander42.Command("list").description("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
7003
7042
|
const opts = cmd.optsWithGlobals();
|
|
7004
7043
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7062,7 +7101,7 @@ function clusterIpAclRow(ipAcl) {
|
|
|
7062
7101
|
];
|
|
7063
7102
|
}
|
|
7064
7103
|
function uuidOutput(opts, result, label) {
|
|
7065
|
-
process.stderr.write(
|
|
7104
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
7066
7105
|
`));
|
|
7067
7106
|
output(opts, {
|
|
7068
7107
|
headers: ["field", "value"],
|
|
@@ -7083,7 +7122,7 @@ async function confirmDangerousAction(message, yes) {
|
|
|
7083
7122
|
const { confirm } = await import("@inquirer/prompts");
|
|
7084
7123
|
const ok = await confirm({ message, default: false });
|
|
7085
7124
|
if (!ok) {
|
|
7086
|
-
process.stderr.write(
|
|
7125
|
+
process.stderr.write(import_chalk14.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7087
7126
|
}
|
|
7088
7127
|
return ok;
|
|
7089
7128
|
}
|
|
@@ -7133,7 +7172,7 @@ var deleteCommand3 = new import_commander42.Command("delete").description("NKS \
|
|
|
7133
7172
|
throw err;
|
|
7134
7173
|
}
|
|
7135
7174
|
stopSpinner(true);
|
|
7136
|
-
process.stderr.write(
|
|
7175
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7137
7176
|
`));
|
|
7138
7177
|
});
|
|
7139
7178
|
var resizeCommand2 = new import_commander42.Command("resize").description("NKS \uD074\uB7EC\uC2A4\uD130 \uB178\uB4DC \uADF8\uB8F9 \uD06C\uAE30\uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--nodegroup <name-or-uuid>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--node-count <n>", "\uBCC0\uACBD\uD560 \uB178\uB4DC \uC218").option("--nodes-to-remove <csv>", "\uC0AD\uC81C\uD560 \uB178\uB4DC \uC774\uB984/ID CSV").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, _opts, cmd) => {
|
|
@@ -7141,7 +7180,7 @@ var resizeCommand2 = new import_commander42.Command("resize").description("NKS \
|
|
|
7141
7180
|
const nodeCount = parsePositiveInteger(opts.nodeCount, "--node-count");
|
|
7142
7181
|
const nodesToRemove = opts.nodesToRemove?.split(",").map((node) => node.trim()).filter(Boolean);
|
|
7143
7182
|
if (!nodesToRemove || nodesToRemove.length === 0) {
|
|
7144
|
-
process.stderr.write(
|
|
7183
|
+
process.stderr.write(import_chalk14.default.yellow("\uC8FC\uC758: --nodes-to-remove \uAC00 \uC5C6\uC73C\uBA74 \uAC10\uCD95 \uC2DC API\uAC00 \uC0AD\uC81C \uB178\uB4DC\uB97C \uC120\uD0DD\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n"));
|
|
7145
7184
|
}
|
|
7146
7185
|
const { client } = await resolveNksClient(opts);
|
|
7147
7186
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 resize \uC694\uCCAD \uC911...");
|
|
@@ -7305,7 +7344,7 @@ var kubeconfigCommand = new import_commander42.Command("kubeconfig").description
|
|
|
7305
7344
|
stopSpinner(true);
|
|
7306
7345
|
if (opts.output) {
|
|
7307
7346
|
await writeKubeconfigFile(opts.output, kubeconfig, opts.force);
|
|
7308
|
-
process.stderr.write(
|
|
7347
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 kubeconfig \uB97C \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4: ${opts.output}
|
|
7309
7348
|
`));
|
|
7310
7349
|
return;
|
|
7311
7350
|
}
|
|
@@ -7435,7 +7474,7 @@ var clusterCommand = new import_commander42.Command("cluster").description("NKS
|
|
|
7435
7474
|
|
|
7436
7475
|
// src/commands/nks/nodegroup.ts
|
|
7437
7476
|
var import_commander43 = require("commander");
|
|
7438
|
-
var
|
|
7477
|
+
var import_chalk15 = __toESM(require("chalk"));
|
|
7439
7478
|
function nodeGroupRow(nodegroup) {
|
|
7440
7479
|
return [
|
|
7441
7480
|
nodegroup.uuid,
|
|
@@ -7452,7 +7491,7 @@ function rawObjectRows(resource) {
|
|
|
7452
7491
|
]);
|
|
7453
7492
|
}
|
|
7454
7493
|
function uuidOutput2(opts, result, label) {
|
|
7455
|
-
process.stderr.write(
|
|
7494
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
7456
7495
|
`));
|
|
7457
7496
|
output(opts, {
|
|
7458
7497
|
headers: ["field", "value"],
|
|
@@ -7485,7 +7524,7 @@ async function confirmDangerousAction2(message, yes) {
|
|
|
7485
7524
|
if (!isTTY || yes) return true;
|
|
7486
7525
|
const { confirm } = await import("@inquirer/prompts");
|
|
7487
7526
|
const ok = await confirm({ message, default: false });
|
|
7488
|
-
if (!ok) process.stderr.write(
|
|
7527
|
+
if (!ok) process.stderr.write(import_chalk15.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7489
7528
|
return ok;
|
|
7490
7529
|
}
|
|
7491
7530
|
var listCommand7 = new import_commander43.Command("list").description("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, _opts, cmd) => {
|
|
@@ -7554,7 +7593,7 @@ var deleteCommand4 = new import_commander43.Command("delete").description("NKS \
|
|
|
7554
7593
|
throw err;
|
|
7555
7594
|
}
|
|
7556
7595
|
stopSpinner(true);
|
|
7557
|
-
process.stderr.write(
|
|
7596
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7558
7597
|
`));
|
|
7559
7598
|
});
|
|
7560
7599
|
function nodeActionCommand(name) {
|
|
@@ -7795,7 +7834,7 @@ var addonCommand = new import_commander44.Command("addon").description("NKS \uC5
|
|
|
7795
7834
|
|
|
7796
7835
|
// src/commands/ncs/template.ts
|
|
7797
7836
|
var import_commander45 = require("commander");
|
|
7798
|
-
var
|
|
7837
|
+
var import_chalk16 = __toESM(require("chalk"));
|
|
7799
7838
|
|
|
7800
7839
|
// src/commands/ncs/helpers.ts
|
|
7801
7840
|
var import_node_fs9 = require("fs");
|
|
@@ -7900,8 +7939,7 @@ function normalizeNcsTimeRange(from, to, now) {
|
|
|
7900
7939
|
...normalizedTo === void 0 ? {} : { to: normalizedTo.value }
|
|
7901
7940
|
};
|
|
7902
7941
|
}
|
|
7903
|
-
async function resolveNcsAppKey(profileName
|
|
7904
|
-
if (appKeyOpt) return appKeyOpt;
|
|
7942
|
+
async function resolveNcsAppKey(profileName) {
|
|
7905
7943
|
let cred;
|
|
7906
7944
|
try {
|
|
7907
7945
|
cred = await getServiceCredential("ncs", profileName);
|
|
@@ -7912,7 +7950,7 @@ async function resolveNcsAppKey(profileName, appKeyOpt) {
|
|
|
7912
7950
|
}
|
|
7913
7951
|
if (!cred?.appkey) {
|
|
7914
7952
|
throw new NhnCloudCliError(
|
|
7915
|
-
"NCS appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure
|
|
7953
|
+
"NCS appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure --ncs-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694.",
|
|
7916
7954
|
EXIT_CONFIG_ERROR
|
|
7917
7955
|
);
|
|
7918
7956
|
}
|
|
@@ -7922,7 +7960,7 @@ async function resolveNcsClient(opts) {
|
|
|
7922
7960
|
const profileName = await resolveProfileName(opts.profile);
|
|
7923
7961
|
const uak = await getUserAccessKey(profileName);
|
|
7924
7962
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
7925
|
-
const appKey = await resolveNcsAppKey(profileName
|
|
7963
|
+
const appKey = await resolveNcsAppKey(profileName);
|
|
7926
7964
|
const region = opts.region ?? "kr1";
|
|
7927
7965
|
return { client: new NcsClient(accessToken, region, appKey), profileName };
|
|
7928
7966
|
}
|
|
@@ -7978,7 +8016,7 @@ async function confirmDestructive(message, yes) {
|
|
|
7978
8016
|
}
|
|
7979
8017
|
|
|
7980
8018
|
// src/commands/ncs/template.ts
|
|
7981
|
-
var listCommand8 = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8019
|
+
var listCommand8 = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (_opts, cmd) => {
|
|
7982
8020
|
const opts = cmd.optsWithGlobals();
|
|
7983
8021
|
const { client } = await resolveNcsClient(opts);
|
|
7984
8022
|
startSpinner("NCS \uC124\uACC4\uB3C4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8009,7 +8047,7 @@ var listCommand8 = new import_commander45.Command("list").description("NCS \uC12
|
|
|
8009
8047
|
ids: templates.map((t) => t.id)
|
|
8010
8048
|
});
|
|
8011
8049
|
});
|
|
8012
|
-
var getCommand6 = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8050
|
+
var getCommand6 = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8013
8051
|
const opts = cmd.optsWithGlobals();
|
|
8014
8052
|
requireNonEmpty(id, "id");
|
|
8015
8053
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8037,7 +8075,7 @@ var getCommand6 = new import_commander45.Command("get").description("NCS \uC124\
|
|
|
8037
8075
|
ids: [template.id]
|
|
8038
8076
|
});
|
|
8039
8077
|
});
|
|
8040
|
-
var createCommand6 = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "template \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8078
|
+
var createCommand6 = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "template \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8041
8079
|
const opts = cmd.optsWithGlobals();
|
|
8042
8080
|
const payload = readJsonPayload(opts.file);
|
|
8043
8081
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8065,12 +8103,12 @@ var createCommand6 = new import_commander45.Command("create").description("NCS \
|
|
|
8065
8103
|
ids: [template.id]
|
|
8066
8104
|
});
|
|
8067
8105
|
});
|
|
8068
|
-
var deleteCommand5 = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8106
|
+
var deleteCommand5 = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8069
8107
|
const opts = cmd.optsWithGlobals();
|
|
8070
8108
|
requireNonEmpty(id, "id");
|
|
8071
8109
|
const ok = await confirmDestructive(`NCS \uC124\uACC4\uB3C4 "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
8072
8110
|
if (!ok) {
|
|
8073
|
-
process.stderr.write(
|
|
8111
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8074
8112
|
return;
|
|
8075
8113
|
}
|
|
8076
8114
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8082,10 +8120,10 @@ var deleteCommand5 = new import_commander45.Command("delete").description("NCS \
|
|
|
8082
8120
|
throw err;
|
|
8083
8121
|
}
|
|
8084
8122
|
stopSpinner(true);
|
|
8085
|
-
process.stderr.write(
|
|
8123
|
+
process.stderr.write(import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8086
8124
|
`));
|
|
8087
8125
|
});
|
|
8088
|
-
var versionListCommand = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uBC84\uC804 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8126
|
+
var versionListCommand = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uBC84\uC804 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--q <query>", "\uAC80\uC0C9\uC5B4").option("--sort <sort>", "\uC815\uB82C \uC870\uAC74").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (id, _opts, cmd) => {
|
|
8089
8127
|
const opts = cmd.optsWithGlobals();
|
|
8090
8128
|
requireNonEmpty(id, "id");
|
|
8091
8129
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8118,7 +8156,7 @@ var versionListCommand = new import_commander45.Command("list").description("NCS
|
|
|
8118
8156
|
ids: versions.map((v) => v.id)
|
|
8119
8157
|
});
|
|
8120
8158
|
});
|
|
8121
|
-
var versionGetCommand = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8159
|
+
var versionGetCommand = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
8122
8160
|
const opts = cmd.optsWithGlobals();
|
|
8123
8161
|
requireNonEmpty(id, "id");
|
|
8124
8162
|
requireNonEmpty(version, "version");
|
|
@@ -8139,7 +8177,7 @@ var versionGetCommand = new import_commander45.Command("get").description("NCS \
|
|
|
8139
8177
|
ids: [detail.id]
|
|
8140
8178
|
});
|
|
8141
8179
|
});
|
|
8142
|
-
var versionCreateCommand = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uC0C8 \uBC84\uC804\uC744 \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, sourceVersion \uD544\uC218)").argument("<id>", "template ID").requiredOption("--file <path>", "\uBC84\uC804 \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C (sourceVersion \uD544\uB4DC \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8180
|
+
var versionCreateCommand = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uC0C8 \uBC84\uC804\uC744 \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, sourceVersion \uD544\uC218)").argument("<id>", "template ID").requiredOption("--file <path>", "\uBC84\uC804 \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C (sourceVersion \uD544\uB4DC \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8143
8181
|
const opts = cmd.optsWithGlobals();
|
|
8144
8182
|
requireNonEmpty(id, "id");
|
|
8145
8183
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8160,7 +8198,7 @@ var versionCreateCommand = new import_commander45.Command("create").description(
|
|
|
8160
8198
|
ids: [version.id]
|
|
8161
8199
|
});
|
|
8162
8200
|
});
|
|
8163
|
-
var versionDeleteCommand = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8201
|
+
var versionDeleteCommand = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
8164
8202
|
const opts = cmd.optsWithGlobals();
|
|
8165
8203
|
requireNonEmpty(id, "id");
|
|
8166
8204
|
requireNonEmpty(version, "version");
|
|
@@ -8169,7 +8207,7 @@ var versionDeleteCommand = new import_commander45.Command("delete").description(
|
|
|
8169
8207
|
opts.yes
|
|
8170
8208
|
);
|
|
8171
8209
|
if (!ok) {
|
|
8172
|
-
process.stderr.write(
|
|
8210
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8173
8211
|
return;
|
|
8174
8212
|
}
|
|
8175
8213
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8182,7 +8220,7 @@ var versionDeleteCommand = new import_commander45.Command("delete").description(
|
|
|
8182
8220
|
}
|
|
8183
8221
|
stopSpinner(true);
|
|
8184
8222
|
process.stderr.write(
|
|
8185
|
-
|
|
8223
|
+
import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uBC84\uC804 "${version}" \uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8186
8224
|
`)
|
|
8187
8225
|
);
|
|
8188
8226
|
});
|
|
@@ -8191,7 +8229,7 @@ var templateCommand = new import_commander45.Command("template").description("NC
|
|
|
8191
8229
|
|
|
8192
8230
|
// src/commands/ncs/workload.ts
|
|
8193
8231
|
var import_commander46 = require("commander");
|
|
8194
|
-
var
|
|
8232
|
+
var import_chalk17 = __toESM(require("chalk"));
|
|
8195
8233
|
function workloadRows(w) {
|
|
8196
8234
|
return [
|
|
8197
8235
|
[
|
|
@@ -8205,7 +8243,7 @@ function workloadRows(w) {
|
|
|
8205
8243
|
];
|
|
8206
8244
|
}
|
|
8207
8245
|
var WORKLOAD_HEADERS = ["id", "name", "type", "status", "desired", "available"];
|
|
8208
|
-
var listCommand9 = new import_commander46.Command("list").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8246
|
+
var listCommand9 = new import_commander46.Command("list").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--q <query>", "\uC6CC\uD06C\uB85C\uB4DC \uC774\uB984\xB7\uD15C\uD50C\uB9BF ID\xB7\uD15C\uD50C\uB9BF \uBC84\uC804\uC73C\uB85C \uD544\uD130\uB9C1").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (_opts, cmd) => {
|
|
8209
8247
|
const opts = cmd.optsWithGlobals();
|
|
8210
8248
|
const { client } = await resolveNcsClient(opts);
|
|
8211
8249
|
startSpinner("NCS workload \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8238,7 +8276,7 @@ var listCommand9 = new import_commander46.Command("list").description("NCS workl
|
|
|
8238
8276
|
ids: workloads.map((w) => w.id)
|
|
8239
8277
|
});
|
|
8240
8278
|
});
|
|
8241
|
-
var getCommand7 = new import_commander46.Command("get").description("NCS workload \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8279
|
+
var getCommand7 = new import_commander46.Command("get").description("NCS workload \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8242
8280
|
const opts = cmd.optsWithGlobals();
|
|
8243
8281
|
requireNonEmpty(id, "id");
|
|
8244
8282
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8268,7 +8306,7 @@ var getCommand7 = new import_commander46.Command("get").description("NCS workloa
|
|
|
8268
8306
|
ids: [workload.id]
|
|
8269
8307
|
});
|
|
8270
8308
|
});
|
|
8271
|
-
var logsCommand = new import_commander46.Command("logs").description("NCS workload task \uC758 \uCEE8\uD14C\uC774\uB108 \uB85C\uADF8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8309
|
+
var logsCommand = new import_commander46.Command("logs").description("NCS workload task \uC758 \uCEE8\uD14C\uC774\uB108 \uB85C\uADF8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").option("--container <name>", "\uCEE8\uD14C\uC774\uB108 \uC774\uB984 (\uD544\uC218)").option(
|
|
8272
8310
|
"--from <time>",
|
|
8273
8311
|
"\uB85C\uADF8 \uC2DC\uC791: \uC2DC\uAC04\uB300 \uD3EC\uD568 RFC3339, now \uB610\uB294 0 \uC774\uC0C1\uC758 \uC815\uC218\uC640 m/h/d \uB2E8\uC704 (\uC608: 30m, 1h, 2d). UTC Z\uB85C \uC815\uADDC\uD654\uD558\uBA70 \uC0DD\uB7B5 \uC2DC API \uAE30\uBCF8 \uBC94\uC704"
|
|
8274
8312
|
).option(
|
|
@@ -8313,7 +8351,7 @@ var logsCommand = new import_commander46.Command("logs").description("NCS worklo
|
|
|
8313
8351
|
ids: []
|
|
8314
8352
|
});
|
|
8315
8353
|
});
|
|
8316
|
-
var eventsCommand2 = new import_commander46.Command("events").description("NCS workload task \uC758 \uC774\uBCA4\uD2B8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8354
|
+
var eventsCommand2 = new import_commander46.Command("events").description("NCS workload task \uC758 \uC774\uBCA4\uD2B8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").option("--type <type>", "\uC774\uBCA4\uD2B8 \uD0C0\uC785 (Normal | Warning)").option("--q <query>", "\uC774\uBCA4\uD2B8 \uB0B4\uC6A9 \uD544\uD130\uB9C1").option(
|
|
8317
8355
|
"--from <time>",
|
|
8318
8356
|
"\uC774\uBCA4\uD2B8 \uC2DC\uC791: \uC2DC\uAC04\uB300 \uD3EC\uD568 RFC3339, now \uB610\uB294 0 \uC774\uC0C1\uC758 \uC815\uC218\uC640 m/h/d \uB2E8\uC704 (\uC608: 30m, 1h, 2d). UTC Z\uB85C \uC815\uADDC\uD654\uD558\uBA70 \uC0DD\uB7B5 \uC2DC API \uAE30\uBCF8 \uBC94\uC704"
|
|
8319
8357
|
).option(
|
|
@@ -8355,7 +8393,7 @@ var eventsCommand2 = new import_commander46.Command("events").description("NCS w
|
|
|
8355
8393
|
ids: []
|
|
8356
8394
|
});
|
|
8357
8395
|
});
|
|
8358
|
-
var historyGetCommand = new import_commander46.Command("get").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8396
|
+
var historyGetCommand = new import_commander46.Command("get").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, historyId, _opts, cmd) => {
|
|
8359
8397
|
const opts = cmd.optsWithGlobals();
|
|
8360
8398
|
requireNonEmpty(id, "id");
|
|
8361
8399
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8384,7 +8422,7 @@ var historyGetCommand = new import_commander46.Command("get").description("NCS w
|
|
|
8384
8422
|
ids: [String(detail.id)]
|
|
8385
8423
|
});
|
|
8386
8424
|
});
|
|
8387
|
-
var historyCommand = new import_commander46.Command("history").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8425
|
+
var historyCommand = new import_commander46.Command("history").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").option("--sort <sort>", "\uC815\uB82C \uAE30\uC900 \uD544\uB4DC\uBA85 (\uC5ED\uC21C\uC740 \uD544\uB4DC\uBA85 \uC55E\uC5D0 - \uB97C \uBD99\uC784, \uC608: -id)").action(async (id, _opts, cmd) => {
|
|
8388
8426
|
const opts = cmd.optsWithGlobals();
|
|
8389
8427
|
requireNonEmpty(id, "id");
|
|
8390
8428
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8417,7 +8455,7 @@ var historyCommand = new import_commander46.Command("history").description("NCS
|
|
|
8417
8455
|
ids: history.map((h) => String(h.id))
|
|
8418
8456
|
});
|
|
8419
8457
|
}).addCommand(historyGetCommand);
|
|
8420
|
-
var scheduleHistoryCommand = new import_commander46.Command("schedule-history").description("NCS workload \uC608\uC57D \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8458
|
+
var scheduleHistoryCommand = new import_commander46.Command("schedule-history").description("NCS workload \uC608\uC57D \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8421
8459
|
const opts = cmd.optsWithGlobals();
|
|
8422
8460
|
requireNonEmpty(id, "id");
|
|
8423
8461
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8438,7 +8476,7 @@ var scheduleHistoryCommand = new import_commander46.Command("schedule-history").
|
|
|
8438
8476
|
ids: scheduleHistory.map((s) => s.id)
|
|
8439
8477
|
});
|
|
8440
8478
|
});
|
|
8441
|
-
var createCommand7 = new import_commander46.Command("create").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "workload \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--wait", "workload \uAC00 Running \uC0C1\uD0DC\uAC00 \uB420 \uB54C\uAE4C\uC9C0 \uB300\uAE30").option("--timeout <sec>", "wait \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 300)", "300").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8479
|
+
var createCommand7 = new import_commander46.Command("create").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "workload \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--wait", "workload \uAC00 Running \uC0C1\uD0DC\uAC00 \uB420 \uB54C\uAE4C\uC9C0 \uB300\uAE30").option("--timeout <sec>", "wait \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 300)", "300").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8442
8480
|
const opts = cmd.optsWithGlobals();
|
|
8443
8481
|
const payload = readJsonPayload(opts.file);
|
|
8444
8482
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
@@ -8469,7 +8507,7 @@ var createCommand7 = new import_commander46.Command("create").description("NCS w
|
|
|
8469
8507
|
ids: [workload.id]
|
|
8470
8508
|
});
|
|
8471
8509
|
});
|
|
8472
|
-
var updateCommand = new import_commander46.Command("update").description("NCS workload \uB97C \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, PUT)").argument("<id>", "workload ID").requiredOption("--file <path>", "workload \uAD50\uCCB4 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8510
|
+
var updateCommand = new import_commander46.Command("update").description("NCS workload \uB97C \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, PUT)").argument("<id>", "workload ID").requiredOption("--file <path>", "workload \uAD50\uCCB4 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8473
8511
|
const opts = cmd.optsWithGlobals();
|
|
8474
8512
|
requireNonEmpty(id, "id");
|
|
8475
8513
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8490,7 +8528,7 @@ var updateCommand = new import_commander46.Command("update").description("NCS wo
|
|
|
8490
8528
|
ids: [workload.id]
|
|
8491
8529
|
});
|
|
8492
8530
|
});
|
|
8493
|
-
var patchCommand = new import_commander46.Command("patch").description("NCS workload \uB97C \uBD80\uBD84 \uBCC0\uACBD\uD55C\uB2E4 (--file \uB85C JSON Patch \uBC30\uC5F4 \uC804\uB2EC, RFC 6902)").argument("<id>", "workload ID").requiredOption("--file <path>", "JSON Patch \uBC30\uC5F4(op/path/value)\uC774 \uB2F4\uAE34 \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8531
|
+
var patchCommand = new import_commander46.Command("patch").description("NCS workload \uB97C \uBD80\uBD84 \uBCC0\uACBD\uD55C\uB2E4 (--file \uB85C JSON Patch \uBC30\uC5F4 \uC804\uB2EC, RFC 6902)").argument("<id>", "workload ID").requiredOption("--file <path>", "JSON Patch \uBC30\uC5F4(op/path/value)\uC774 \uB2F4\uAE34 \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8494
8532
|
const opts = cmd.optsWithGlobals();
|
|
8495
8533
|
requireNonEmpty(id, "id");
|
|
8496
8534
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8511,7 +8549,7 @@ var patchCommand = new import_commander46.Command("patch").description("NCS work
|
|
|
8511
8549
|
ids: [workload.id]
|
|
8512
8550
|
});
|
|
8513
8551
|
});
|
|
8514
|
-
var pauseCommand = new import_commander46.Command("pause").description("NCS workload \uB97C \uC77C\uC2DC\uC815\uC9C0\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8552
|
+
var pauseCommand = new import_commander46.Command("pause").description("NCS workload \uB97C \uC77C\uC2DC\uC815\uC9C0\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8515
8553
|
const opts = cmd.optsWithGlobals();
|
|
8516
8554
|
requireNonEmpty(id, "id");
|
|
8517
8555
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8523,10 +8561,10 @@ var pauseCommand = new import_commander46.Command("pause").description("NCS work
|
|
|
8523
8561
|
throw err;
|
|
8524
8562
|
}
|
|
8525
8563
|
stopSpinner(true);
|
|
8526
|
-
process.stderr.write(
|
|
8564
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC77C\uC2DC\uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8527
8565
|
`));
|
|
8528
8566
|
});
|
|
8529
|
-
var resumeCommand = new import_commander46.Command("resume").description("NCS workload \uB97C \uC7AC\uAC1C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8567
|
+
var resumeCommand = new import_commander46.Command("resume").description("NCS workload \uB97C \uC7AC\uAC1C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8530
8568
|
const opts = cmd.optsWithGlobals();
|
|
8531
8569
|
requireNonEmpty(id, "id");
|
|
8532
8570
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8538,10 +8576,10 @@ var resumeCommand = new import_commander46.Command("resume").description("NCS wo
|
|
|
8538
8576
|
throw err;
|
|
8539
8577
|
}
|
|
8540
8578
|
stopSpinner(true);
|
|
8541
|
-
process.stderr.write(
|
|
8579
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC7AC\uAC1C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8542
8580
|
`));
|
|
8543
8581
|
});
|
|
8544
|
-
var restartCommand = new import_commander46.Command("restart").description("NCS workload task \uB97C \uC7AC\uC2DC\uC791\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8582
|
+
var restartCommand = new import_commander46.Command("restart").description("NCS workload task \uB97C \uC7AC\uC2DC\uC791\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").action(async (id, _opts, cmd) => {
|
|
8545
8583
|
const opts = cmd.optsWithGlobals();
|
|
8546
8584
|
requireNonEmpty(id, "id");
|
|
8547
8585
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -8560,16 +8598,16 @@ var restartCommand = new import_commander46.Command("restart").description("NCS
|
|
|
8560
8598
|
}
|
|
8561
8599
|
stopSpinner(true);
|
|
8562
8600
|
process.stderr.write(
|
|
8563
|
-
|
|
8601
|
+
import_chalk17.default.green(`\u2713 NCS workload "${id}" task "${opts.task}" \uAC00 \uC7AC\uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8564
8602
|
`)
|
|
8565
8603
|
);
|
|
8566
8604
|
});
|
|
8567
|
-
var deleteCommand6 = new import_commander46.Command("delete").description("NCS workload \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "workload ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8605
|
+
var deleteCommand6 = new import_commander46.Command("delete").description("NCS workload \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "workload ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8568
8606
|
const opts = cmd.optsWithGlobals();
|
|
8569
8607
|
requireNonEmpty(id, "id");
|
|
8570
8608
|
const ok = await confirmDestructive(`NCS workload "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
8571
8609
|
if (!ok) {
|
|
8572
|
-
process.stderr.write(
|
|
8610
|
+
process.stderr.write(import_chalk17.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8573
8611
|
return;
|
|
8574
8612
|
}
|
|
8575
8613
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8581,7 +8619,7 @@ var deleteCommand6 = new import_commander46.Command("delete").description("NCS w
|
|
|
8581
8619
|
throw err;
|
|
8582
8620
|
}
|
|
8583
8621
|
stopSpinner(true);
|
|
8584
|
-
process.stderr.write(
|
|
8622
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8585
8623
|
`));
|
|
8586
8624
|
});
|
|
8587
8625
|
var workloadCommand = new import_commander46.Command("workload").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uAD00\uB9AC").addCommand(listCommand9).addCommand(getCommand7).addCommand(logsCommand).addCommand(eventsCommand2).addCommand(historyCommand).addCommand(scheduleHistoryCommand).addCommand(createCommand7).addCommand(updateCommand).addCommand(patchCommand).addCommand(pauseCommand).addCommand(resumeCommand).addCommand(restartCommand).addCommand(deleteCommand6);
|
|
@@ -8596,7 +8634,7 @@ function parseEnabledOption(value) {
|
|
|
8596
8634
|
EXIT_PARAM_ERROR
|
|
8597
8635
|
);
|
|
8598
8636
|
}
|
|
8599
|
-
var configGetCommand = new import_commander47.Command("get").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8637
|
+
var configGetCommand = new import_commander47.Command("get").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8600
8638
|
const opts = cmd.optsWithGlobals();
|
|
8601
8639
|
const { client } = await resolveNcsClient(opts);
|
|
8602
8640
|
startSpinner("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uC870\uD68C \uC911...");
|
|
@@ -8615,7 +8653,7 @@ var configGetCommand = new import_commander47.Command("get").description("NCS \u
|
|
|
8615
8653
|
ids: []
|
|
8616
8654
|
});
|
|
8617
8655
|
});
|
|
8618
|
-
var configSetCommand = new import_commander47.Command("set").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").requiredOption("--enabled <true|false>", "\uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC0AC\uC6A9 \uC5EC\uBD80").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8656
|
+
var configSetCommand = new import_commander47.Command("set").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").requiredOption("--enabled <true|false>", "\uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC0AC\uC6A9 \uC5EC\uBD80").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8619
8657
|
const opts = cmd.optsWithGlobals();
|
|
8620
8658
|
const enabled = parseEnabledOption(opts.enabled);
|
|
8621
8659
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8636,7 +8674,7 @@ var configSetCommand = new import_commander47.Command("set").description("NCS \u
|
|
|
8636
8674
|
});
|
|
8637
8675
|
});
|
|
8638
8676
|
var configCommand = new import_commander47.Command("config").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uAD00\uB9AC").addCommand(configGetCommand).addCommand(configSetCommand);
|
|
8639
|
-
var resultCommand = new import_commander47.Command("result").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uC758 \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<workloadId>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--
|
|
8677
|
+
var resultCommand = new import_commander47.Command("result").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uC758 \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<workloadId>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (workloadId, historyId, _opts, cmd) => {
|
|
8640
8678
|
const opts = cmd.optsWithGlobals();
|
|
8641
8679
|
requireNonEmpty(workloadId, "workloadId");
|
|
8642
8680
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -11083,9 +11121,9 @@ Agent workflow:
|
|
|
11083
11121
|
`;
|
|
11084
11122
|
var deployAgentWorkflow = `
|
|
11085
11123
|
Agent workflow:
|
|
11086
|
-
1. nhncloud deploy artifacts
|
|
11087
|
-
2. nhncloud deploy server-groups <
|
|
11088
|
-
3. nhncloud deploy run <
|
|
11124
|
+
1. nhncloud deploy artifacts --json
|
|
11125
|
+
2. nhncloud deploy server-groups --artifact-id <artifact-id> --json
|
|
11126
|
+
3. nhncloud deploy run --artifact-id <artifact-id> --server-group-id <server-group-id> --scenario-ids <ids>
|
|
11089
11127
|
`;
|
|
11090
11128
|
var instanceAgentWorkflow = `
|
|
11091
11129
|
Agent workflow:
|
|
@@ -11135,7 +11173,7 @@ Agent workflow:
|
|
|
11135
11173
|
3. nhncloud ncs workload get <id> --json
|
|
11136
11174
|
`;
|
|
11137
11175
|
var program = new import_commander57.Command();
|
|
11138
|
-
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.
|
|
11176
|
+
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.15.0").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "\uCD5C\uC18C \uCD9C\uB825 (\uC790\uB3D9\uD654\uC6A9)").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654").option("--request-timeout <sec>", "HTTP \uC694\uCCAD \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 30, \uBC94\uC704 1~3600). NHNCLOUD_REQUEST_TIMEOUT \uB85C\uB3C4 \uC9C0\uC815").addHelpText("after", rootAgentHints);
|
|
11139
11177
|
program.hook("preAction", () => {
|
|
11140
11178
|
const opts = program.opts();
|
|
11141
11179
|
const rawTimeout = opts.requestTimeout ?? process.env["NHNCLOUD_REQUEST_TIMEOUT"];
|
|
@@ -11146,7 +11184,7 @@ program.hook("preAction", () => {
|
|
|
11146
11184
|
{ min: 1, max: 3600 }
|
|
11147
11185
|
);
|
|
11148
11186
|
if (!opts.color || process.env["NO_COLOR"]) {
|
|
11149
|
-
|
|
11187
|
+
import_chalk18.default.level = 0;
|
|
11150
11188
|
}
|
|
11151
11189
|
if (opts.json || opts.quiet) {
|
|
11152
11190
|
setQuiet(true);
|
|
@@ -11162,6 +11200,9 @@ logncrashCommand.addCommand(sendCommand);
|
|
|
11162
11200
|
logncrashCommand.addCommand(exportCommand);
|
|
11163
11201
|
program.addCommand(logncrashCommand);
|
|
11164
11202
|
var deployCommand2 = new import_commander57.Command("deploy").description("NHN Cloud Deploy \uAD00\uB828 \uBA85\uB839").addHelpText("after", deployAgentWorkflow);
|
|
11203
|
+
deployCommand2.hook("preSubcommand", async () => {
|
|
11204
|
+
await warnLegacyDeployTargets();
|
|
11205
|
+
});
|
|
11165
11206
|
deployCommand2.addCommand(runCommand);
|
|
11166
11207
|
deployCommand2.addCommand(artifactsCommand);
|
|
11167
11208
|
deployCommand2.addCommand(serverGroupsCommand);
|
|
@@ -11245,6 +11286,6 @@ program.parseAsync().catch((err) => {
|
|
|
11245
11286
|
err instanceof Error ? err.message : String(err)
|
|
11246
11287
|
);
|
|
11247
11288
|
const exitCode = err instanceof NhnCloudCliError ? err.exitCode : 1;
|
|
11248
|
-
process.stderr.write(
|
|
11289
|
+
process.stderr.write(import_chalk18.default.red(`\uC624\uB958: ${message}`) + "\n");
|
|
11249
11290
|
process.exit(exitCode);
|
|
11250
11291
|
});
|