@bifos/nhncloud-cli 0.14.0 → 0.16.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 +16 -9
- package/dist/index.js +843 -674
- package/package.json +1 -1
- package/skills/nhncloud-cli/SKILL.md +2 -2
- package/skills/nhncloud-cli/references/common.md +2 -2
- package/skills/nhncloud-cli/references/deploy.md +40 -43
- package/skills/nhncloud-cli/references/logncrash.md +76 -10
- package/skills/nhncloud-cli/references/ncr.md +5 -7
- package/skills/nhncloud-cli/references/ncs.md +37 -39
package/dist/index.js
CHANGED
|
@@ -24,8 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
var
|
|
28
|
-
var
|
|
27
|
+
var import_commander59 = require("commander");
|
|
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
|
}
|
|
@@ -257,6 +193,18 @@ nhncloud configure \uB97C \uC2E4\uD589\uD574 UAK id/secret \uC744 \uC124\uC815\u
|
|
|
257
193
|
return uak;
|
|
258
194
|
}
|
|
259
195
|
async function getServiceCredential(service, profileName) {
|
|
196
|
+
const cred = await getOptionalServiceCredential(service, profileName);
|
|
197
|
+
if (!cred) {
|
|
198
|
+
throw new NhnCloudCliError(
|
|
199
|
+
`profile "${profileName}" \uC5D0 "${service}" \uC790\uACA9\uC99D\uBA85\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
|
|
200
|
+
${CREDENTIALS_PATH} \uC5D0\uC11C profiles.${profileName}.${service} \uBE14\uB85D\uC744 \uCD94\uAC00\uD558\uC138\uC694.
|
|
201
|
+
\uC608\uC2DC: { "appkey": "<appkey>" }`,
|
|
202
|
+
EXIT_CONFIG_ERROR
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
return cred;
|
|
206
|
+
}
|
|
207
|
+
async function getOptionalServiceCredential(service, profileName) {
|
|
260
208
|
if (service === "userAccessKey" || service === "iaas") {
|
|
261
209
|
throw new NhnCloudCliError(
|
|
262
210
|
`"${service}" \uB294 \uC11C\uBE44\uC2A4 \uC790\uACA9\uC99D\uBA85\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uC804\uC6A9 getter \uB97C \uC0AC\uC6A9\uD558\uC138\uC694.`,
|
|
@@ -272,16 +220,7 @@ ${CREDENTIALS_PATH} \uC5D0\uC11C profiles.${profileName} \uBE14\uB85D\uC744 \uCD
|
|
|
272
220
|
EXIT_CONFIG_ERROR
|
|
273
221
|
);
|
|
274
222
|
}
|
|
275
|
-
|
|
276
|
-
if (!cred) {
|
|
277
|
-
throw new NhnCloudCliError(
|
|
278
|
-
`profile "${profileName}" \uC5D0 "${service}" \uC790\uACA9\uC99D\uBA85\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
|
|
279
|
-
${CREDENTIALS_PATH} \uC5D0\uC11C profiles.${profileName}.${service} \uBE14\uB85D\uC744 \uCD94\uAC00\uD558\uC138\uC694.
|
|
280
|
-
\uC608\uC2DC: { "appkey": "<appkey>" }`,
|
|
281
|
-
EXIT_CONFIG_ERROR
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
return cred;
|
|
223
|
+
return profile[service];
|
|
285
224
|
}
|
|
286
225
|
async function loadCredentialsOrEmpty() {
|
|
287
226
|
try {
|
|
@@ -353,21 +292,114 @@ async function setIaasCredential(profileName, iaas) {
|
|
|
353
292
|
creds.profiles[profileName] = { ...profile, iaas };
|
|
354
293
|
await saveCredentials(creds);
|
|
355
294
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const targets =
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
);
|
|
295
|
+
function isLegacyDeployConfig(value) {
|
|
296
|
+
if (typeof value !== "object" || value === null) return false;
|
|
297
|
+
const targets = value["targets"];
|
|
298
|
+
return targets === void 0 || typeof targets === "object" && targets !== null;
|
|
299
|
+
}
|
|
300
|
+
async function warnLegacyDeployTargets() {
|
|
301
|
+
let parsed;
|
|
302
|
+
try {
|
|
303
|
+
parsed = await readConfigJson();
|
|
304
|
+
} catch (err) {
|
|
305
|
+
if (err instanceof NhnCloudCliError && err.exitCode === EXIT_CONFIG_ERROR) return;
|
|
306
|
+
throw err;
|
|
307
|
+
}
|
|
308
|
+
if (typeof parsed !== "object" || parsed === null) return;
|
|
309
|
+
const deploy = parsed["deploy"];
|
|
310
|
+
if (!isLegacyDeployConfig(deploy)) return;
|
|
311
|
+
if (!deploy.targets || Object.keys(deploy.targets).length === 0) return;
|
|
312
|
+
process.stderr.write(
|
|
313
|
+
import_chalk.default.yellow(
|
|
314
|
+
"\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"
|
|
315
|
+
)
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// src/utils/terminal.ts
|
|
320
|
+
function sanitizeForTerminal(value) {
|
|
321
|
+
return value.replace(/[\x00-\x1F\x7F]/g, "?");
|
|
322
|
+
}
|
|
323
|
+
function sanitizeMultilineForTerminal(value) {
|
|
324
|
+
return value.replace(/[\x00-\x09\x0B-\x1F\x7F]/g, "?");
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// src/api/timeout.ts
|
|
328
|
+
var SYNC_FLOOR_MS = 6e5;
|
|
329
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
330
|
+
var SYNC_TIMEOUT_MS = SYNC_FLOOR_MS;
|
|
331
|
+
function setRequestTimeoutMs(ms) {
|
|
332
|
+
if (!Number.isInteger(ms) || ms < 1) {
|
|
333
|
+
throw new Error(`setRequestTimeoutMs: 1 \uC774\uC0C1\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${String(ms)}).`);
|
|
334
|
+
}
|
|
335
|
+
DEFAULT_TIMEOUT_MS = ms;
|
|
336
|
+
SYNC_TIMEOUT_MS = Math.max(ms, SYNC_FLOOR_MS);
|
|
337
|
+
}
|
|
338
|
+
function getRequestTimeoutMs() {
|
|
339
|
+
return DEFAULT_TIMEOUT_MS;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// src/commands/parse-options.ts
|
|
343
|
+
var POSITIVE_INTEGER_PATTERN = /^[1-9]\d*$/;
|
|
344
|
+
var NON_NEGATIVE_INTEGER_PATTERN = /^(0|[1-9]\d*)$/;
|
|
345
|
+
function parseRequiredArgument(value, label) {
|
|
346
|
+
const trimmed = value.trim();
|
|
347
|
+
if (!trimmed) {
|
|
348
|
+
throw new NhnCloudCliError(`${label} \uC778\uC218\uAC00 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
367
349
|
}
|
|
368
|
-
return
|
|
350
|
+
return trimmed;
|
|
351
|
+
}
|
|
352
|
+
function describeRange({ min, max }) {
|
|
353
|
+
if (min !== void 0 && max !== void 0) return `${min} \uC774\uC0C1 ${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
354
|
+
if (min !== void 0) return `${min} \uC774\uC0C1\uC758 \uC815\uC218`;
|
|
355
|
+
if (max !== void 0) return `${max} \uC774\uD558\uC758 \uC815\uC218`;
|
|
356
|
+
return "0 \uC774\uC0C1\uC758 \uC815\uC218";
|
|
357
|
+
}
|
|
358
|
+
function throwIntegerOptionError(value, flag, range) {
|
|
359
|
+
throw new NhnCloudCliError(
|
|
360
|
+
`${flag} \uB294 ${describeRange(range)}\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uC785\uB825: ${JSON.stringify(value)}).`,
|
|
361
|
+
EXIT_PARAM_ERROR
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
function parseIntegerOption(value, flag, range) {
|
|
365
|
+
if (value === void 0) return void 0;
|
|
366
|
+
const pattern = range.min !== void 0 && range.min > 0 ? POSITIVE_INTEGER_PATTERN : NON_NEGATIVE_INTEGER_PATTERN;
|
|
367
|
+
if (!pattern.test(value)) {
|
|
368
|
+
throwIntegerOptionError(value, flag, range);
|
|
369
|
+
}
|
|
370
|
+
const parsed = Number(value);
|
|
371
|
+
if (!Number.isInteger(parsed) || range.min !== void 0 && parsed < range.min || range.max !== void 0 && parsed > range.max) {
|
|
372
|
+
throwIntegerOptionError(value, flag, range);
|
|
373
|
+
}
|
|
374
|
+
return parsed;
|
|
375
|
+
}
|
|
376
|
+
function parsePositiveIntegerOption(value, flag) {
|
|
377
|
+
return parseIntegerOption(value, flag, { min: 1 });
|
|
378
|
+
}
|
|
379
|
+
function parseNonNegativeIntegerOption(value, flag) {
|
|
380
|
+
return parseIntegerOption(value, flag, { min: 0 });
|
|
369
381
|
}
|
|
370
382
|
|
|
383
|
+
// src/commands/commander-errors.ts
|
|
384
|
+
var import_commander = require("commander");
|
|
385
|
+
function throwWithNormalizedExitCode(error) {
|
|
386
|
+
if (error.code === "commander.missingMandatoryOptionValue") {
|
|
387
|
+
error.exitCode = EXIT_PARAM_ERROR;
|
|
388
|
+
}
|
|
389
|
+
throw error;
|
|
390
|
+
}
|
|
391
|
+
function configureCommanderExitCodes(root) {
|
|
392
|
+
root.exitOverride(throwWithNormalizedExitCode);
|
|
393
|
+
for (const command of root.commands) {
|
|
394
|
+
configureCommanderExitCodes(command);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// src/commands/configure.ts
|
|
399
|
+
var import_commander2 = require("commander");
|
|
400
|
+
var import_chalk2 = __toESM(require("chalk"));
|
|
401
|
+
var import_core = require("@inquirer/core");
|
|
402
|
+
|
|
371
403
|
// src/api/oauth.ts
|
|
372
404
|
var import_ky2 = __toESM(require("ky"));
|
|
373
405
|
|
|
@@ -769,6 +801,13 @@ function unwrap(res) {
|
|
|
769
801
|
return res.body;
|
|
770
802
|
}
|
|
771
803
|
|
|
804
|
+
// src/services/logncrash/types.ts
|
|
805
|
+
function isAvailableTokenResult(value) {
|
|
806
|
+
if (typeof value !== "object" || value === null) return false;
|
|
807
|
+
const availableToken = value["availableToken"];
|
|
808
|
+
return typeof availableToken === "number" && Number.isSafeInteger(availableToken);
|
|
809
|
+
}
|
|
810
|
+
|
|
772
811
|
// src/services/logncrash/errors.ts
|
|
773
812
|
var import_ky4 = require("ky");
|
|
774
813
|
var RATE_LIMIT_RESULT_CODE = 429;
|
|
@@ -778,7 +817,7 @@ function isRateLimitError(err) {
|
|
|
778
817
|
function withRateLimitHint(err) {
|
|
779
818
|
return new NhnCloudCliError(
|
|
780
819
|
`${err.message}
|
|
781
|
-
\uC870\uD68C \uD69F\uC218 \uC81C\uD55C\uC5D0 \uAC78\uB838\uC2B5\uB2C8\uB2E4. \
|
|
820
|
+
\uC870\uD68C \uD69F\uC218 \uC81C\uD55C\uC5D0 \uAC78\uB838\uC2B5\uB2C8\uB2E4. \uC790\uB3D9\uC73C\uB85C \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9 \uAE30\uAC04\uB9CC \uC881\uD600 \uD574\uACB0\uC744 \uBCF4\uC7A5\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud logncrash available-token\uC73C\uB85C \uC794\uB7C9\uACFC \uCD94\uC815 \uB300\uAE30 \uC2DC\uAC04\uC744 \uB2E4\uC2DC \uD655\uC778\uD558\uC138\uC694.`,
|
|
782
821
|
err.exitCode
|
|
783
822
|
);
|
|
784
823
|
}
|
|
@@ -817,6 +856,28 @@ var LogncrashClient = class {
|
|
|
817
856
|
this.appkey = appkey;
|
|
818
857
|
this.accessToken = accessToken;
|
|
819
858
|
}
|
|
859
|
+
async availableToken() {
|
|
860
|
+
const headers = this.readHeaders();
|
|
861
|
+
const endpoint = endpointFor("logncrash");
|
|
862
|
+
const url = `${endpoint}/v3/${encodeURIComponent(this.appkey)}/logs/available-token`;
|
|
863
|
+
try {
|
|
864
|
+
const res = await import_ky5.default.get(url, {
|
|
865
|
+
headers,
|
|
866
|
+
retry: 0,
|
|
867
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
868
|
+
}).json();
|
|
869
|
+
const body = unwrap(res);
|
|
870
|
+
if (!isAvailableTokenResult(body)) {
|
|
871
|
+
throw new NhnCloudCliError(
|
|
872
|
+
"logncrash available-token \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 availableToken \uC815\uC218 \uD544\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
873
|
+
EXIT_API_ERROR
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
return body;
|
|
877
|
+
} catch (err) {
|
|
878
|
+
throw await toLogncrashError(err);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
820
881
|
async cursorSearch(params) {
|
|
821
882
|
const headers = this.readHeaders();
|
|
822
883
|
const endpoint = endpointFor("logncrash");
|
|
@@ -1907,12 +1968,12 @@ async function verifyLogncrash(uak, appkey) {
|
|
|
1907
1968
|
}
|
|
1908
1969
|
|
|
1909
1970
|
// src/commands/configure.ts
|
|
1910
|
-
async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigateway, doVerify, logncrashUak = uak) {
|
|
1971
|
+
async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigateway, deploy, doVerify, logncrashUak = uak) {
|
|
1911
1972
|
if (doVerify) {
|
|
1912
1973
|
if (uak) {
|
|
1913
1974
|
const ok = await verifyUserAccessKey(uak);
|
|
1914
1975
|
if (ok) {
|
|
1915
|
-
process.stderr.write(
|
|
1976
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 UAK \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1916
1977
|
} else {
|
|
1917
1978
|
throw new NhnCloudCliError(
|
|
1918
1979
|
"UAK \uC778\uC99D \uC2E4\uD328 \u2014 uak-id / uak-secret \uC744 \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1929,7 +1990,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1929
1990
|
}
|
|
1930
1991
|
const ok = await verifyLogncrash(logncrashUak, logncrash.appkey ?? "");
|
|
1931
1992
|
if (ok) {
|
|
1932
|
-
process.stderr.write(
|
|
1993
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 logncrash \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1933
1994
|
} else {
|
|
1934
1995
|
throw new NhnCloudCliError(
|
|
1935
1996
|
"logncrash \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK\uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1940,7 +2001,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1940
2001
|
if (iaas) {
|
|
1941
2002
|
const ok = await verifyIaas(iaas);
|
|
1942
2003
|
if (ok) {
|
|
1943
|
-
process.stderr.write(
|
|
2004
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 iaas \uC5F0\uACB0 \uC131\uACF5\n"));
|
|
1944
2005
|
} else {
|
|
1945
2006
|
throw new NhnCloudCliError(
|
|
1946
2007
|
"iaas \uC778\uC99D \uC2E4\uD328 \u2014 tenantId / username / API \uBE44\uBC00\uBC88\uD638\uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1953,7 +2014,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1953
2014
|
const appkey = ncr.appkey ?? "";
|
|
1954
2015
|
const ok = await verifyNcr(uak, appkey);
|
|
1955
2016
|
if (ok) {
|
|
1956
|
-
process.stderr.write(
|
|
2017
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 ncr \uC5F0\uACB0 \uC131\uACF5 (kr1)\n"));
|
|
1957
2018
|
} else {
|
|
1958
2019
|
throw new NhnCloudCliError(
|
|
1959
2020
|
"ncr \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK \uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1962,7 +2023,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1962
2023
|
}
|
|
1963
2024
|
} else {
|
|
1964
2025
|
process.stderr.write(
|
|
1965
|
-
|
|
2026
|
+
import_chalk2.default.yellow(
|
|
1966
2027
|
" \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
2028
|
)
|
|
1968
2029
|
);
|
|
@@ -1973,7 +2034,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1973
2034
|
const appkey = ncs.appkey ?? "";
|
|
1974
2035
|
const ok = await verifyNcs(uak, appkey);
|
|
1975
2036
|
if (ok) {
|
|
1976
|
-
process.stderr.write(
|
|
2037
|
+
process.stderr.write(import_chalk2.default.green(" \u2713 ncs \uC5F0\uACB0 \uC131\uACF5 (kr1)\n"));
|
|
1977
2038
|
} else {
|
|
1978
2039
|
throw new NhnCloudCliError(
|
|
1979
2040
|
"ncs \uC778\uC99D \uC2E4\uD328 \u2014 appkey \uB610\uB294 UAK \uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
@@ -1982,7 +2043,7 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
1982
2043
|
}
|
|
1983
2044
|
} else {
|
|
1984
2045
|
process.stderr.write(
|
|
1985
|
-
|
|
2046
|
+
import_chalk2.default.yellow(
|
|
1986
2047
|
" \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
2048
|
)
|
|
1988
2049
|
);
|
|
@@ -2007,7 +2068,10 @@ async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigat
|
|
|
2007
2068
|
if (apigateway) {
|
|
2008
2069
|
await setServiceCredential(profileName, "apigateway", apigateway);
|
|
2009
2070
|
}
|
|
2010
|
-
|
|
2071
|
+
if (deploy) {
|
|
2072
|
+
await setServiceCredential(profileName, "deploy", deploy);
|
|
2073
|
+
}
|
|
2074
|
+
process.stderr.write(import_chalk2.default.green(`
|
|
2011
2075
|
\u2713 profile "${profileName}" \uC124\uC815\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
2012
2076
|
`));
|
|
2013
2077
|
}
|
|
@@ -2038,7 +2102,7 @@ async function runInteractive(opts) {
|
|
|
2038
2102
|
}
|
|
2039
2103
|
}
|
|
2040
2104
|
if (!uak) {
|
|
2041
|
-
process.stderr.write(
|
|
2105
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 \uAC1C\uC778 UAK (User Access Key) \u2014\n"));
|
|
2042
2106
|
const uakId = await input({
|
|
2043
2107
|
message: "UAK ID"
|
|
2044
2108
|
});
|
|
@@ -2054,7 +2118,7 @@ async function runInteractive(opts) {
|
|
|
2054
2118
|
default: false
|
|
2055
2119
|
});
|
|
2056
2120
|
if (setupLogncrash) {
|
|
2057
|
-
process.stderr.write(
|
|
2121
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 logncrash \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2058
2122
|
const appkey = await input({
|
|
2059
2123
|
message: "logncrash appkey",
|
|
2060
2124
|
validate: (v) => v.trim().length > 0 || "logncrash appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
@@ -2067,9 +2131,9 @@ async function runInteractive(opts) {
|
|
|
2067
2131
|
default: false
|
|
2068
2132
|
});
|
|
2069
2133
|
if (setupIaas) {
|
|
2070
|
-
process.stderr.write(
|
|
2134
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 iaas (Compute) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2071
2135
|
process.stderr.write(
|
|
2072
|
-
|
|
2136
|
+
import_chalk2.default.yellow(
|
|
2073
2137
|
" \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
2138
|
)
|
|
2075
2139
|
);
|
|
@@ -2095,7 +2159,7 @@ async function runInteractive(opts) {
|
|
|
2095
2159
|
default: false
|
|
2096
2160
|
});
|
|
2097
2161
|
if (setupNcr) {
|
|
2098
|
-
process.stderr.write(
|
|
2162
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 ncr (Container Registry) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2099
2163
|
const ncrAppkey = await input({
|
|
2100
2164
|
message: "ncr appkey",
|
|
2101
2165
|
validate: (v) => v.trim().length > 0 || "ncr appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
@@ -2108,38 +2172,51 @@ async function runInteractive(opts) {
|
|
|
2108
2172
|
default: false
|
|
2109
2173
|
});
|
|
2110
2174
|
if (setupNcs) {
|
|
2111
|
-
process.stderr.write(
|
|
2175
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 ncs (Container Service) \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2112
2176
|
const ncsAppkey = await input({
|
|
2113
2177
|
message: "ncs appkey",
|
|
2114
2178
|
validate: (v) => v.trim().length > 0 || "ncs appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
2115
2179
|
});
|
|
2116
2180
|
ncs = { appkey: ncsAppkey.trim() };
|
|
2117
2181
|
}
|
|
2182
|
+
let deploy;
|
|
2183
|
+
const setupDeploy = await confirm({
|
|
2184
|
+
message: "deploy \uC790\uACA9\uC99D\uBA85\uB3C4 \uC124\uC815\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
2185
|
+
default: false
|
|
2186
|
+
});
|
|
2187
|
+
if (setupDeploy) {
|
|
2188
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 deploy \uC790\uACA9\uC99D\uBA85 \u2014\n"));
|
|
2189
|
+
const deployAppkey = await input({
|
|
2190
|
+
message: "deploy appkey",
|
|
2191
|
+
validate: (v) => v.trim().length > 0 || "deploy appkey \uB97C \uC785\uB825\uD558\uC138\uC694"
|
|
2192
|
+
});
|
|
2193
|
+
deploy = { appkey: deployAppkey.trim() };
|
|
2194
|
+
}
|
|
2118
2195
|
if (opts.verify) {
|
|
2119
|
-
process.stderr.write(
|
|
2196
|
+
process.stderr.write(import_chalk2.default.gray("\n\u2014 \uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC911\u2026 \u2014\n"));
|
|
2120
2197
|
}
|
|
2121
2198
|
if (opts.verify) {
|
|
2122
2199
|
try {
|
|
2123
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, true, uak);
|
|
2200
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, true, uak);
|
|
2124
2201
|
} catch (err) {
|
|
2125
2202
|
if (err instanceof NhnCloudCliError && err.exitCode === EXIT_AUTH_ERROR) {
|
|
2126
|
-
process.stderr.write(
|
|
2203
|
+
process.stderr.write(import_chalk2.default.red(` \u2717 ${sanitizeMultilineForTerminal(err.message)}
|
|
2127
2204
|
`));
|
|
2128
2205
|
const saveDespite = await confirm({
|
|
2129
2206
|
message: "\uAC80\uC99D \uC2E4\uD328\uC5D0\uB3C4 \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
2130
2207
|
default: false
|
|
2131
2208
|
});
|
|
2132
2209
|
if (!saveDespite) {
|
|
2133
|
-
process.stderr.write(
|
|
2210
|
+
process.stderr.write(import_chalk2.default.yellow("\uC800\uC7A5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
2134
2211
|
return;
|
|
2135
2212
|
}
|
|
2136
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, false, uak);
|
|
2213
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, false, uak);
|
|
2137
2214
|
} else {
|
|
2138
2215
|
throw err;
|
|
2139
2216
|
}
|
|
2140
2217
|
}
|
|
2141
2218
|
} else {
|
|
2142
|
-
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, false, uak);
|
|
2219
|
+
await saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, void 0, deploy, false, uak);
|
|
2143
2220
|
}
|
|
2144
2221
|
}
|
|
2145
2222
|
async function runNonInteractive(opts) {
|
|
@@ -2163,9 +2240,12 @@ async function runNonInteractive(opts) {
|
|
|
2163
2240
|
if (opts.apigatewayAppkey !== void 0 && opts.apigatewayAppkey.trim().length === 0) {
|
|
2164
2241
|
throw new NhnCloudCliError("--apigateway-appkey \uAC12\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
2165
2242
|
}
|
|
2243
|
+
if (opts.deployAppkey !== void 0 && opts.deployAppkey.trim().length === 0) {
|
|
2244
|
+
throw new NhnCloudCliError("--deploy-appkey \uAC12\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
2245
|
+
}
|
|
2166
2246
|
if (opts.logncrashSecret !== void 0) {
|
|
2167
2247
|
process.stderr.write(
|
|
2168
|
-
|
|
2248
|
+
import_chalk2.default.yellow(
|
|
2169
2249
|
"\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
2250
|
)
|
|
2171
2251
|
);
|
|
@@ -2182,9 +2262,10 @@ async function runNonInteractive(opts) {
|
|
|
2182
2262
|
const ncr = opts.ncrAppkey?.trim() ? { appkey: opts.ncrAppkey.trim() } : void 0;
|
|
2183
2263
|
const ncs = opts.ncsAppkey?.trim() ? { appkey: opts.ncsAppkey.trim() } : void 0;
|
|
2184
2264
|
const apigateway = opts.apigatewayAppkey?.trim() ? { appkey: opts.apigatewayAppkey.trim() } : void 0;
|
|
2185
|
-
|
|
2265
|
+
const deploy = opts.deployAppkey?.trim() ? { appkey: opts.deployAppkey.trim() } : void 0;
|
|
2266
|
+
if (!uak && !logncrash && !iaas && !ncr && !ncs && !apigateway && !deploy) {
|
|
2186
2267
|
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 --
|
|
2268
|
+
"\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
2269
|
EXIT_PARAM_ERROR
|
|
2189
2270
|
);
|
|
2190
2271
|
}
|
|
@@ -2193,7 +2274,7 @@ async function runNonInteractive(opts) {
|
|
|
2193
2274
|
logncrashUak = await getUserAccessKey(profileName);
|
|
2194
2275
|
}
|
|
2195
2276
|
if (opts.verify) {
|
|
2196
|
-
process.stderr.write(
|
|
2277
|
+
process.stderr.write(import_chalk2.default.gray("\uC5F0\uACB0 \uD14C\uC2A4\uD2B8 \uC911\u2026\n"));
|
|
2197
2278
|
}
|
|
2198
2279
|
await saveAndVerify(
|
|
2199
2280
|
profileName,
|
|
@@ -2203,15 +2284,16 @@ async function runNonInteractive(opts) {
|
|
|
2203
2284
|
ncr,
|
|
2204
2285
|
ncs,
|
|
2205
2286
|
apigateway,
|
|
2287
|
+
deploy,
|
|
2206
2288
|
opts.verify,
|
|
2207
2289
|
logncrashUak
|
|
2208
2290
|
);
|
|
2209
2291
|
}
|
|
2210
|
-
var configureCommand = new
|
|
2292
|
+
var configureCommand = new import_commander2.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
2293
|
"--iaas-password <pass>",
|
|
2212
2294
|
"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;
|
|
2295
|
+
).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) => {
|
|
2296
|
+
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
2297
|
try {
|
|
2216
2298
|
if (hasFlag) {
|
|
2217
2299
|
await runNonInteractive(opts);
|
|
@@ -2220,7 +2302,7 @@ var configureCommand = new import_commander.Command("configure").description("\u
|
|
|
2220
2302
|
}
|
|
2221
2303
|
} catch (err) {
|
|
2222
2304
|
if (err instanceof import_core.ExitPromptError) {
|
|
2223
|
-
process.stderr.write(
|
|
2305
|
+
process.stderr.write(import_chalk2.default.yellow("\n\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
2224
2306
|
return;
|
|
2225
2307
|
}
|
|
2226
2308
|
throw err;
|
|
@@ -2228,7 +2310,7 @@ var configureCommand = new import_commander.Command("configure").description("\u
|
|
|
2228
2310
|
});
|
|
2229
2311
|
|
|
2230
2312
|
// src/commands/skills.ts
|
|
2231
|
-
var
|
|
2313
|
+
var import_commander3 = require("commander");
|
|
2232
2314
|
|
|
2233
2315
|
// src/skill/context.ts
|
|
2234
2316
|
var import_node_fs = require("fs");
|
|
@@ -3043,7 +3125,7 @@ async function showStatus(cmd, dependencies) {
|
|
|
3043
3125
|
outputSkillStatus(opts, await dependencies.inspect(context));
|
|
3044
3126
|
}
|
|
3045
3127
|
function createInstallCommand(name, dependencies) {
|
|
3046
|
-
return new
|
|
3128
|
+
return new import_commander3.Command(name).description(
|
|
3047
3129
|
name === "install" ? "Claude Code \uC2A4\uD0AC\uC744 \uAD00\uB9AC \uC800\uC7A5\uC18C\uC5D0 \uC124\uCE58\uD55C\uB2E4" : "Claude Code \uC2A4\uD0AC\uC744 \uD604\uC7AC CLI \uBC84\uC804\uC73C\uB85C \uAC31\uC2E0\uD55C\uB2E4"
|
|
3048
3130
|
).option("--force", "\uC0AC\uC6A9\uC790 \uD56D\uBAA9\uC774\uB098 \uC218\uC815\xB7\uC190\uC0C1\uB41C \uAD00\uB9AC \uC800\uC7A5\uC18C\uB97C \uBC31\uC5C5 \uD6C4 \uAD50\uCCB4\uD55C\uB2E4").action(async (_localOpts, cmd) => {
|
|
3049
3131
|
const opts = cmd.optsWithGlobals();
|
|
@@ -3053,8 +3135,8 @@ function createInstallCommand(name, dependencies) {
|
|
|
3053
3135
|
});
|
|
3054
3136
|
}
|
|
3055
3137
|
function createSkillsCommand(dependencies = defaultDependencies) {
|
|
3056
|
-
const statusCommand = new
|
|
3057
|
-
const uninstallCommand = new
|
|
3138
|
+
const statusCommand = new import_commander3.Command("status").description("Claude Code \uC2A4\uD0AC\uC758 \uAD00\uB9AC \uC0C1\uD0DC\uB97C \uC870\uD68C\uD55C\uB2E4").action(async (_opts, cmd) => showStatus(cmd, dependencies));
|
|
3139
|
+
const uninstallCommand = new import_commander3.Command("uninstall").description("\uD65C\uC131 Claude Code \uC2A4\uD0AC \uB9C1\uD06C\uB97C \uC81C\uAC70\uD55C\uB2E4").action(async (_opts, cmd) => {
|
|
3058
3140
|
const opts = cmd.optsWithGlobals();
|
|
3059
3141
|
const context = dependencies.createContext();
|
|
3060
3142
|
const previousStatus = await dependencies.inspect(context);
|
|
@@ -3069,13 +3151,13 @@ function createSkillsCommand(dependencies = defaultDependencies) {
|
|
|
3069
3151
|
};
|
|
3070
3152
|
outputSkillUninstallResult(opts, result);
|
|
3071
3153
|
});
|
|
3072
|
-
return new
|
|
3154
|
+
return new import_commander3.Command("skills").description(`Claude Code \uC2A4\uD0AC(${SKILL_NAME3}) \uC124\uCE58 \uAD00\uB9AC`).addCommand(statusCommand).addCommand(createInstallCommand("install", dependencies)).addCommand(createInstallCommand("update", dependencies)).addCommand(uninstallCommand).action(async (_opts, cmd) => showStatus(cmd, dependencies));
|
|
3073
3155
|
}
|
|
3074
3156
|
var skillsCommand = createSkillsCommand();
|
|
3075
3157
|
|
|
3076
3158
|
// src/commands/doctor.ts
|
|
3077
|
-
var
|
|
3078
|
-
var
|
|
3159
|
+
var import_commander4 = require("commander");
|
|
3160
|
+
var import_chalk3 = __toESM(require("chalk"));
|
|
3079
3161
|
var import_promises4 = require("fs/promises");
|
|
3080
3162
|
var import_node_os4 = require("os");
|
|
3081
3163
|
var import_node_path6 = __toESM(require("path"));
|
|
@@ -3105,47 +3187,47 @@ async function readDefaultProfile() {
|
|
|
3105
3187
|
return null;
|
|
3106
3188
|
}
|
|
3107
3189
|
}
|
|
3108
|
-
var doctorCommand = new
|
|
3109
|
-
console.log(
|
|
3190
|
+
var doctorCommand = new import_commander4.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 () => {
|
|
3191
|
+
console.log(import_chalk3.default.bold("\n\u{1F50D} nhncloud-cli \uC9C4\uB2E8\n"));
|
|
3110
3192
|
const creds = await readProfiles();
|
|
3111
3193
|
const defaultProfile = await readDefaultProfile();
|
|
3112
|
-
console.log(
|
|
3194
|
+
console.log(import_chalk3.default.bold("\uC790\uACA9\uC99D\uBA85"));
|
|
3113
3195
|
if (creds.missing) {
|
|
3114
|
-
console.log(` ${
|
|
3196
|
+
console.log(` ${import_chalk3.default.red("\u274C \uBBF8\uC124\uC815")} \u2014 ${CREDENTIALS_PATH2} \uC5C6\uC74C. nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
3115
3197
|
} else if (creds.parseError) {
|
|
3116
|
-
console.log(` ${
|
|
3198
|
+
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
3199
|
} else if (creds.profiles.length === 0) {
|
|
3118
|
-
console.log(` ${
|
|
3200
|
+
console.log(` ${import_chalk3.default.yellow("\u26A0 profile \uC5C6\uC74C")} \u2014 nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
3119
3201
|
} else {
|
|
3120
|
-
console.log(` ${
|
|
3121
|
-
console.log(` \uAE30\uBCF8 profile: ${defaultProfile ?
|
|
3202
|
+
console.log(` ${import_chalk3.default.green("\u2713 \uC124\uC815\uB428")} \u2014 profile: ${creds.profiles.join(", ")}`);
|
|
3203
|
+
console.log(` \uAE30\uBCF8 profile: ${defaultProfile ? import_chalk3.default.green(defaultProfile) : import_chalk3.default.gray("\uBBF8\uC9C0\uC815 (default \uC0AC\uC6A9)")}`);
|
|
3122
3204
|
}
|
|
3123
|
-
console.log(
|
|
3205
|
+
console.log(import_chalk3.default.bold("\nClaude Code \uC2A4\uD0AC"));
|
|
3124
3206
|
const skillStatus = await inspectSkill(createSkillManagerContext());
|
|
3125
3207
|
if (skillStatus.status === "current") {
|
|
3126
3208
|
console.log(
|
|
3127
|
-
` ${SKILL_NAME4}: ${
|
|
3209
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.green(`\u2713 current (${skillStatus.installedVersion ?? skillStatus.currentVersion})`)}`
|
|
3128
3210
|
);
|
|
3129
3211
|
} else if (skillStatus.status === "missing") {
|
|
3130
3212
|
console.log(
|
|
3131
|
-
` ${SKILL_NAME4}: ${
|
|
3213
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.gray(`\uBBF8\uC124\uCE58 \u2014 ${skillRecoveryCommand(skillStatus.status)}`)}`
|
|
3132
3214
|
);
|
|
3133
3215
|
} else {
|
|
3134
3216
|
console.log(
|
|
3135
|
-
` ${SKILL_NAME4}: ${
|
|
3217
|
+
` ${SKILL_NAME4}: ${import_chalk3.default.yellow(`\u26A0 ${skillStatus.status}`)} \u2014 ${skillRecoveryCommand(skillStatus.status)}`
|
|
3136
3218
|
);
|
|
3137
3219
|
}
|
|
3138
3220
|
console.log();
|
|
3139
3221
|
if (!creds.missing && !creds.parseError && creds.profiles.length > 0) {
|
|
3140
|
-
console.log(
|
|
3222
|
+
console.log(import_chalk3.default.green("\u2713 \uAE30\uBCF8 \uC124\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
3141
3223
|
} else {
|
|
3142
|
-
console.log(
|
|
3224
|
+
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4: nhncloud configure"));
|
|
3143
3225
|
}
|
|
3144
3226
|
console.log();
|
|
3145
3227
|
});
|
|
3146
3228
|
|
|
3147
3229
|
// src/commands/logncrash/search.ts
|
|
3148
|
-
var
|
|
3230
|
+
var import_commander5 = require("commander");
|
|
3149
3231
|
|
|
3150
3232
|
// src/utils/time.ts
|
|
3151
3233
|
function toLocalISOString(date) {
|
|
@@ -3263,6 +3345,22 @@ function assertSearchRange(fromIso, toIso) {
|
|
|
3263
3345
|
}
|
|
3264
3346
|
}
|
|
3265
3347
|
|
|
3348
|
+
// src/services/logncrash/token.ts
|
|
3349
|
+
var OBSERVED_REFILL_RATE_PER_SECOND = 1.6;
|
|
3350
|
+
function availableTokenStatus(availableToken) {
|
|
3351
|
+
return {
|
|
3352
|
+
availableToken,
|
|
3353
|
+
estimatedWaitSeconds: availableToken > 0 ? null : Math.ceil((1 - availableToken) / OBSERVED_REFILL_RATE_PER_SECOND)
|
|
3354
|
+
};
|
|
3355
|
+
}
|
|
3356
|
+
function assertAvailableSearchToken(status) {
|
|
3357
|
+
if (status.estimatedWaitSeconds === null) return;
|
|
3358
|
+
throw new NhnCloudCliError(
|
|
3359
|
+
`\uC870\uD68C \uD1A0\uD070 \uC794\uB7C9\uC774 ${status.availableToken}\uC774\uBBC0\uB85C \uAC80\uC0C9 \uC694\uCCAD\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uAD00\uCE21\uD55C \uD68C\uBCF5 \uC18D\uB3C4 ${OBSERVED_REFILL_RATE_PER_SECOND} token/s \uAE30\uC900\uC73C\uB85C \uC794\uB7C9\uC774 \uC591\uC218\uAC00 \uB418\uAE30\uAE4C\uC9C0 \uC57D ${status.estimatedWaitSeconds}\uCD08\uC785\uB2C8\uB2E4. CLI\uB294 \uC790\uB3D9\uC73C\uB85C \uAE30\uB2E4\uB9AC\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. nhncloud logncrash available-token\uC73C\uB85C \uB2E4\uC2DC \uD655\uC778\uD558\uC138\uC694.`,
|
|
3360
|
+
EXIT_API_ERROR
|
|
3361
|
+
);
|
|
3362
|
+
}
|
|
3363
|
+
|
|
3266
3364
|
// src/commands/logncrash/helpers.ts
|
|
3267
3365
|
async function resolveLogncrashClient(profile) {
|
|
3268
3366
|
const profileName = await resolveProfileName(profile);
|
|
@@ -3277,6 +3375,10 @@ async function resolveLogncrashClient(profile) {
|
|
|
3277
3375
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
3278
3376
|
return new LogncrashClient(credential.appkey, accessToken);
|
|
3279
3377
|
}
|
|
3378
|
+
async function preflightLogncrashSearchToken(client) {
|
|
3379
|
+
const result = await client.availableToken();
|
|
3380
|
+
assertAvailableSearchToken(availableTokenStatus(result.availableToken));
|
|
3381
|
+
}
|
|
3280
3382
|
|
|
3281
3383
|
// src/commands/logncrash/search.ts
|
|
3282
3384
|
function getString(value) {
|
|
@@ -3288,7 +3390,7 @@ function formatLogRow(log) {
|
|
|
3288
3390
|
const body = truncate(getString(log["logBody"] ?? log["body"] ?? log["message"] ?? ""), 60);
|
|
3289
3391
|
return [logTime, logType, body];
|
|
3290
3392
|
}
|
|
3291
|
-
var searchCommand = new
|
|
3393
|
+
var searchCommand = new import_commander5.Command("search").description("Log & Crash \uB85C\uADF8 \uAC80\uC0C9").option("--query <lucene>", "Lucene \uC9C8\uC758 \uBB38\uC790\uC5F4 (\uD544\uC218)").option("--from <time>", "\uAC80\uC0C9 \uC2DC\uC791: \uCD08\xB7\uC2DC\uAC04\uB300 \uD3EC\uD568 ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (1h/30m/2d/now) (\uD544\uC218)").option("--to <time>", "\uAC80\uC0C9 \uB05D: \uCD08\xB7\uC2DC\uAC04\uB300 \uD3EC\uD568 ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (\uD544\uC218)").option("--page <n>", "\uC804\uD658 \uD638\uD658\uC6A9 pageNumber. 0\uB9CC \uD5C8\uC6A9 (\uB2E4\uC74C \uD398\uC774\uC9C0\uB294 --cursor)", "0").option("--size <n>", "pageSize (\uAE30\uBCF8 10, \uCD5C\uB300 100)", "10").option("--cursor <value>", "\uB2E4\uC74C \uD398\uC774\uC9C0 \uC870\uD68C\uC6A9 opaque cursor").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3292
3394
|
const opts = cmd.optsWithGlobals();
|
|
3293
3395
|
if (!opts.query) {
|
|
3294
3396
|
throw new NhnCloudCliError(`--query \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --query 'logType:"NORMAL"'`, EXIT_PARAM_ERROR);
|
|
@@ -3315,6 +3417,12 @@ var searchCommand = new import_commander4.Command("search").description("Log & C
|
|
|
3315
3417
|
assertSearchRange(fromIso, toIso);
|
|
3316
3418
|
const client = await resolveLogncrashClient(opts.profile);
|
|
3317
3419
|
startSpinner("\uB85C\uADF8 \uAC80\uC0C9 \uC911...");
|
|
3420
|
+
try {
|
|
3421
|
+
await preflightLogncrashSearchToken(client);
|
|
3422
|
+
} catch (err) {
|
|
3423
|
+
stopSpinner(false);
|
|
3424
|
+
throw err;
|
|
3425
|
+
}
|
|
3318
3426
|
let result;
|
|
3319
3427
|
try {
|
|
3320
3428
|
result = await client.cursorSearch({
|
|
@@ -3357,7 +3465,7 @@ var searchCommand = new import_commander4.Command("search").description("Log & C
|
|
|
3357
3465
|
});
|
|
3358
3466
|
|
|
3359
3467
|
// src/commands/logncrash/send.ts
|
|
3360
|
-
var
|
|
3468
|
+
var import_commander6 = require("commander");
|
|
3361
3469
|
var import_node_fs3 = require("fs");
|
|
3362
3470
|
var MAX_LOG_BYTES = 8 * 1024 * 1024;
|
|
3363
3471
|
var VALID_LEVELS = ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"];
|
|
@@ -3390,7 +3498,7 @@ function resolveBody(opts) {
|
|
|
3390
3498
|
EXIT_PARAM_ERROR
|
|
3391
3499
|
);
|
|
3392
3500
|
}
|
|
3393
|
-
var sendCommand = new
|
|
3501
|
+
var sendCommand = new import_commander6.Command("send").description("\uB85C\uADF8 \uD55C \uAC74\uC744 Log & Crash \uB85C \uC804\uC1A1\uD55C\uB2E4 (--body / --file / stdin)").option("--body <text>", "\uB85C\uADF8 \uBA54\uC2DC\uC9C0 \uBCF8\uBB38 (\uBBF8\uC9C0\uC815 \uC2DC --file \uB610\uB294 stdin)").option("--file <path>", "\uB85C\uADF8 \uBCF8\uBB38\uC744 \uC77D\uC744 \uD30C\uC77C \uACBD\uB85C").option("--level <level>", "\uB85C\uADF8 \uB808\uBCA8 (DEBUG/INFO/WARN/ERROR/FATAL)").option("--app-version <ver>", "projectVersion (\uBBF8\uC9C0\uC815 \uC2DC \uAE30\uBCF8 '1.0.0')").option("--source <source>", "logSource (collector \uAE30\uBCF8 'http')").option("--type <type>", "logType (collector \uAE30\uBCF8 'log')").option("--host <host>", "\uB85C\uADF8\uB97C \uBCF4\uB0B8 host \uC2DD\uBCC4").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3394
3502
|
const opts = cmd.optsWithGlobals();
|
|
3395
3503
|
const body = resolveBody(opts);
|
|
3396
3504
|
const bytes = Buffer.byteLength(body, "utf-8");
|
|
@@ -3445,11 +3553,12 @@ credentials.json \uC5D0 "appkey": "<appkey>" \uB97C \uCD94\uAC00\uD558\uC138\uC6
|
|
|
3445
3553
|
});
|
|
3446
3554
|
|
|
3447
3555
|
// src/commands/logncrash/export.ts
|
|
3448
|
-
var
|
|
3556
|
+
var import_commander7 = require("commander");
|
|
3449
3557
|
var import_promises5 = require("fs/promises");
|
|
3450
3558
|
var import_node_fs4 = require("fs");
|
|
3451
3559
|
var import_node_crypto4 = require("crypto");
|
|
3452
3560
|
var MAX_TOTAL = 1e5;
|
|
3561
|
+
var defaultExportFileOps = { appendFile: import_promises5.appendFile, rename: import_promises5.rename };
|
|
3453
3562
|
function assertWritable(path5, force) {
|
|
3454
3563
|
if (force) return;
|
|
3455
3564
|
try {
|
|
@@ -3464,183 +3573,233 @@ function assertWritable(path5, force) {
|
|
|
3464
3573
|
EXIT_PARAM_ERROR
|
|
3465
3574
|
);
|
|
3466
3575
|
}
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
if (!opts.from) {
|
|
3473
|
-
throw new NhnCloudCliError("--from \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --from 1h", EXIT_PARAM_ERROR);
|
|
3474
|
-
}
|
|
3475
|
-
if (!opts.to) {
|
|
3476
|
-
throw new NhnCloudCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --to now", EXIT_PARAM_ERROR);
|
|
3477
|
-
}
|
|
3478
|
-
if (!opts.output) {
|
|
3479
|
-
throw new NhnCloudCliError("--output \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --output logs.jsonl", EXIT_PARAM_ERROR);
|
|
3480
|
-
}
|
|
3481
|
-
const format = opts.format ?? "jsonl";
|
|
3482
|
-
if (format !== "jsonl" && format !== "json") {
|
|
3483
|
-
throw new NhnCloudCliError("--format \uC740 jsonl \uB610\uB294 json \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
3484
|
-
}
|
|
3485
|
-
if (opts.size !== void 0) {
|
|
3486
|
-
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
3487
|
-
throw new NhnCloudCliError("--size \uB294 \uC591\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uD638\uD658 \uBC94\uC704 10~100).", EXIT_PARAM_ERROR);
|
|
3576
|
+
function createExportCommand(finalizeOps) {
|
|
3577
|
+
return new import_commander7.Command("export").description("Log & Crash \uB85C\uADF8\uB97C scroll \uB85C \uC804\uCCB4 \uCD94\uCD9C\uD574 \uD30C\uC77C\uB85C \uC800\uC7A5 (\uB300\uB7C9 \uCD94\uCD9C)").option("--query <lucene>", "Lucene \uC9C8\uC758 \uBB38\uC790\uC5F4 (\uD544\uC218)").option("--from <time>", "\uAC80\uC0C9 \uC2DC\uC791: \uCD08\xB7\uC2DC\uAC04\uB300 \uD3EC\uD568 ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (1h/30m/2d/now) (\uD544\uC218)").option("--to <time>", "\uAC80\uC0C9 \uB05D: \uCD08\xB7\uC2DC\uAC04\uB300 \uD3EC\uD568 ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (\uD544\uC218)").option("--output <file>", "\uCD9C\uB825 \uD30C\uC77C \uACBD\uB85C (\uD544\uC218)").option("--format <fmt>", "\uCD9C\uB825 \uD615\uC2DD: jsonl(\uAE30\uBCF8, \uD55C \uC904\uB2F9 \uD55C \uB85C\uADF8) \uB610\uB294 json(\uBC30\uC5F4)", "jsonl").option("--size <n>", "\uD3D0\uAE30 \uC608\uC815: Search v3\uC5D0\uC11C\uB294 \uBB34\uC2DC\uB428 (\uD638\uD658 \uAC80\uC99D \uBC94\uC704 10~100)").option("--force", "\uCD9C\uB825 \uD30C\uC77C\uC774 \uC788\uC73C\uBA74 \uB36E\uC5B4\uC4F4\uB2E4").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3578
|
+
const opts = cmd.optsWithGlobals();
|
|
3579
|
+
if (!opts.query) {
|
|
3580
|
+
throw new NhnCloudCliError(`--query \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --query 'logType:"NORMAL"'`, EXIT_PARAM_ERROR);
|
|
3488
3581
|
}
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
throw new NhnCloudCliError("--size \uB294 10~100 \uC0AC\uC774\uC5EC\uC57C \uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
3582
|
+
if (!opts.from) {
|
|
3583
|
+
throw new NhnCloudCliError("--from \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --from 1h", EXIT_PARAM_ERROR);
|
|
3492
3584
|
}
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
);
|
|
3496
|
-
}
|
|
3497
|
-
const fromIso = resolveTime(opts.from);
|
|
3498
|
-
const toIso = resolveTime(opts.to);
|
|
3499
|
-
assertSearchRange(fromIso, toIso);
|
|
3500
|
-
assertWritable(opts.output, opts.force ?? false);
|
|
3501
|
-
const client = await resolveLogncrashClient(opts.profile);
|
|
3502
|
-
const tmp = opts.output + "." + (0, import_node_crypto4.randomBytes)(4).toString("hex") + ".tmp";
|
|
3503
|
-
let stream = (0, import_node_fs4.createWriteStream)(tmp, { encoding: "utf-8" });
|
|
3504
|
-
const spinner = startSpinner("\uB85C\uADF8 \uCD94\uCD9C \uC911...");
|
|
3505
|
-
let count = 0;
|
|
3506
|
-
let total = 0;
|
|
3507
|
-
let hasUnqueriedWindows = false;
|
|
3508
|
-
let first = true;
|
|
3509
|
-
let bytePosition = 0;
|
|
3510
|
-
let resumeFrom = "";
|
|
3511
|
-
const write = (chunk) => {
|
|
3512
|
-
stream.write(chunk);
|
|
3513
|
-
bytePosition += Buffer.byteLength(chunk, "utf-8");
|
|
3514
|
-
};
|
|
3515
|
-
const writePage = (data) => {
|
|
3516
|
-
for (const log of data) {
|
|
3517
|
-
if (count >= MAX_TOTAL) break;
|
|
3518
|
-
const json = JSON.stringify(log);
|
|
3519
|
-
write(format === "json" ? first ? json : "," + json : json + "\n");
|
|
3520
|
-
first = false;
|
|
3521
|
-
count++;
|
|
3585
|
+
if (!opts.to) {
|
|
3586
|
+
throw new NhnCloudCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --to now", EXIT_PARAM_ERROR);
|
|
3522
3587
|
}
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3588
|
+
if (!opts.output) {
|
|
3589
|
+
throw new NhnCloudCliError("--output \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --output logs.jsonl", EXIT_PARAM_ERROR);
|
|
3590
|
+
}
|
|
3591
|
+
const format = opts.format ?? "jsonl";
|
|
3592
|
+
if (format !== "jsonl" && format !== "json") {
|
|
3593
|
+
throw new NhnCloudCliError("--format \uC740 jsonl \uB610\uB294 json \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
3594
|
+
}
|
|
3595
|
+
if (opts.size !== void 0) {
|
|
3596
|
+
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
3597
|
+
throw new NhnCloudCliError("--size \uB294 \uC591\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4 (\uD638\uD658 \uBC94\uC704 10~100).", EXIT_PARAM_ERROR);
|
|
3598
|
+
}
|
|
3599
|
+
const size = parseInt(opts.size, 10);
|
|
3600
|
+
if (size < 10 || size > 100) {
|
|
3601
|
+
throw new NhnCloudCliError("--size \uB294 10~100 \uC0AC\uC774\uC5EC\uC57C \uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
3602
|
+
}
|
|
3603
|
+
process.stderr.write(
|
|
3604
|
+
"\uACBD\uACE0: logncrash export --size\uB294 \uD3D0\uAE30 \uC608\uC815\uC774\uBA70 Search v3 \uC694\uCCAD\uC5D0\uC11C\uB294 \uBB34\uC2DC\uB429\uB2C8\uB2E4.\n"
|
|
3605
|
+
);
|
|
3606
|
+
}
|
|
3607
|
+
const fromIso = resolveTime(opts.from);
|
|
3608
|
+
const toIso = resolveTime(opts.to);
|
|
3609
|
+
assertSearchRange(fromIso, toIso);
|
|
3610
|
+
assertWritable(opts.output, opts.force ?? false);
|
|
3611
|
+
const client = await resolveLogncrashClient(opts.profile);
|
|
3612
|
+
const id = (0, import_node_crypto4.randomUUID)();
|
|
3613
|
+
const tmp = `${opts.output}.${id}.tmp`;
|
|
3614
|
+
let stream = (0, import_node_fs4.createWriteStream)(tmp, { encoding: "utf-8" });
|
|
3615
|
+
const spinner = startSpinner("\uB85C\uADF8 \uCD94\uCD9C \uC911...");
|
|
3616
|
+
let count = 0;
|
|
3617
|
+
let total = 0;
|
|
3618
|
+
let hasUnqueriedWindows = false;
|
|
3619
|
+
let first = true;
|
|
3620
|
+
let bytePosition = 0;
|
|
3621
|
+
let resumeFrom = "";
|
|
3622
|
+
let failureOrigin = "preflight";
|
|
3623
|
+
const write = (chunk) => {
|
|
3624
|
+
stream.write(chunk);
|
|
3625
|
+
bytePosition += Buffer.byteLength(chunk, "utf-8");
|
|
3532
3626
|
};
|
|
3533
|
-
|
|
3534
|
-
const
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
count
|
|
3540
|
-
|
|
3541
|
-
|
|
3627
|
+
const writePage = (data) => {
|
|
3628
|
+
for (const log of data) {
|
|
3629
|
+
if (count >= MAX_TOTAL) break;
|
|
3630
|
+
const json = JSON.stringify(log);
|
|
3631
|
+
write(format === "json" ? first ? json : "," + json : json + "\n");
|
|
3632
|
+
first = false;
|
|
3633
|
+
count++;
|
|
3634
|
+
}
|
|
3635
|
+
};
|
|
3636
|
+
try {
|
|
3637
|
+
if (format === "json") write("[");
|
|
3638
|
+
let pendingWindows = [{ from: fromIso, to: toIso }];
|
|
3639
|
+
let completedWindows = 0;
|
|
3640
|
+
const progressText = () => {
|
|
3641
|
+
const totalWindows = completedWindows + pendingWindows.length + 1;
|
|
3642
|
+
const windowPart = totalWindows > 1 ? `\uCC3D ${completedWindows + 1}/${totalWindows} ` : "";
|
|
3643
|
+
return `\uB85C\uADF8 \uCD94\uCD9C \uC911... ${windowPart}${count}/${total}`;
|
|
3542
3644
|
};
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3645
|
+
while (pendingWindows.length > 0) {
|
|
3646
|
+
const window = pendingWindows.shift();
|
|
3647
|
+
if (!window) break;
|
|
3648
|
+
resumeFrom = window.from;
|
|
3649
|
+
const checkpoint = {
|
|
3650
|
+
bytesWritten: bytePosition,
|
|
3651
|
+
count,
|
|
3652
|
+
first,
|
|
3653
|
+
total
|
|
3654
|
+
};
|
|
3655
|
+
try {
|
|
3656
|
+
failureOrigin = "preflight";
|
|
3657
|
+
await preflightLogncrashSearchToken(client);
|
|
3658
|
+
failureOrigin = "search";
|
|
3659
|
+
let res = await client.scrollStart({
|
|
3660
|
+
query: opts.query,
|
|
3661
|
+
from: window.from,
|
|
3662
|
+
to: window.to
|
|
3663
|
+
});
|
|
3664
|
+
total += res.totalItems;
|
|
3554
3665
|
writePage(res.data);
|
|
3555
3666
|
spinner.text = progressText();
|
|
3667
|
+
while (res.data.length > 0 && res.scrollKey && count < Math.min(total, MAX_TOTAL)) {
|
|
3668
|
+
failureOrigin = "preflight";
|
|
3669
|
+
await preflightLogncrashSearchToken(client);
|
|
3670
|
+
failureOrigin = "search";
|
|
3671
|
+
res = await scrollNextWithHint(client, res.scrollKey);
|
|
3672
|
+
writePage(res.data);
|
|
3673
|
+
spinner.text = progressText();
|
|
3674
|
+
}
|
|
3675
|
+
completedWindows++;
|
|
3676
|
+
if (count >= MAX_TOTAL && pendingWindows.length > 0) {
|
|
3677
|
+
hasUnqueriedWindows = true;
|
|
3678
|
+
break;
|
|
3679
|
+
}
|
|
3680
|
+
} catch (err) {
|
|
3681
|
+
if (failureOrigin !== "search" || !(err instanceof LogncrashServerError)) throw err;
|
|
3682
|
+
await endAndClose(stream);
|
|
3683
|
+
await (0, import_promises5.truncate)(tmp, checkpoint.bytesWritten);
|
|
3684
|
+
stream = (0, import_node_fs4.createWriteStream)(tmp, { encoding: "utf-8", flags: "a" });
|
|
3685
|
+
bytePosition = checkpoint.bytesWritten;
|
|
3686
|
+
count = checkpoint.count;
|
|
3687
|
+
first = checkpoint.first;
|
|
3688
|
+
total = checkpoint.total;
|
|
3689
|
+
const currentWindowMs = new Date(window.to).getTime() - new Date(window.from).getTime();
|
|
3690
|
+
const smallerWindowMs = Math.ceil(currentWindowMs / 2);
|
|
3691
|
+
if (smallerWindowMs < MIN_SPLIT_WINDOW_MS) throw err;
|
|
3692
|
+
pendingWindows = splitTimeRange(window.from, toIso, smallerWindowMs);
|
|
3556
3693
|
}
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3694
|
+
}
|
|
3695
|
+
await endAndClose(stream);
|
|
3696
|
+
} catch (err) {
|
|
3697
|
+
stopSpinner(false);
|
|
3698
|
+
const failure = failureOrigin === "search" && isRateLimitError(err) ? withRateLimitHint(err) : err;
|
|
3699
|
+
await new Promise((resolve) => {
|
|
3700
|
+
if (stream.closed) {
|
|
3701
|
+
resolve();
|
|
3702
|
+
return;
|
|
3561
3703
|
}
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3704
|
+
stream.once("close", () => resolve());
|
|
3705
|
+
stream.once("error", () => resolve());
|
|
3706
|
+
if (stream.destroyed) return;
|
|
3707
|
+
stream.end();
|
|
3708
|
+
});
|
|
3709
|
+
if (count === 0) {
|
|
3710
|
+
await (0, import_promises5.rm)(tmp, { force: true }).catch(() => {
|
|
3711
|
+
});
|
|
3712
|
+
throw failure;
|
|
3713
|
+
}
|
|
3714
|
+
const partial = `${opts.output}.partial`;
|
|
3715
|
+
try {
|
|
3716
|
+
if (format === "json") await (0, import_promises5.appendFile)(tmp, "]\n");
|
|
3717
|
+
await (0, import_promises5.rename)(tmp, partial);
|
|
3718
|
+
} catch {
|
|
3719
|
+
process.stderr.write(
|
|
3720
|
+
`\uACBD\uACE0: \uBD80\uBD84 \uACB0\uACFC\uB97C ${partial} \uC5D0 \uB0A8\uAE30\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uC784\uC2DC \uD30C\uC77C: ${tmp}
|
|
3721
|
+
`
|
|
3722
|
+
);
|
|
3723
|
+
throw failure;
|
|
3575
3724
|
}
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3725
|
+
process.stderr.write(`\uC548\uB0B4: \uC5EC\uAE30\uAE4C\uC9C0 \uBC1B\uC740 ${count}\uAC74\uC744 ${partial} \uC5D0 \uB0A8\uACBC\uC2B5\uB2C8\uB2E4.
|
|
3726
|
+
`);
|
|
3727
|
+
if (resumeFrom === fromIso) {
|
|
3728
|
+
process.stderr.write(
|
|
3729
|
+
`\uC548\uB0B4: \uC774\uC5B4\uBC1B\uC744 \uC9C0\uC810\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAC19\uC740 \uBA85\uB839\uC744 \uB2E4\uC2DC \uC2E4\uD589\uD558\uBA74 ${count}\uAC74\uB3C4 \uB2E4\uC2DC \uC870\uD68C\uB429\uB2C8\uB2E4.
|
|
3730
|
+
`
|
|
3731
|
+
);
|
|
3732
|
+
} else {
|
|
3733
|
+
process.stderr.write(
|
|
3734
|
+
`\uC548\uB0B4: \uC774\uC5B4\uBC1B\uC73C\uB824\uBA74 --from "${resumeFrom}" --to "${toIso}" \uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694. \uACBD\uACC4 \uAD6C\uAC04\uC758 \uB85C\uADF8\uAC00 \uC911\uBCF5\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
3735
|
+
`
|
|
3736
|
+
);
|
|
3586
3737
|
}
|
|
3587
|
-
stream.once("close", () => resolve());
|
|
3588
|
-
stream.once("error", () => resolve());
|
|
3589
|
-
if (stream.destroyed) return;
|
|
3590
|
-
stream.end();
|
|
3591
|
-
});
|
|
3592
|
-
if (count === 0) {
|
|
3593
|
-
await (0, import_promises5.rm)(tmp, { force: true }).catch(() => {
|
|
3594
|
-
});
|
|
3595
3738
|
throw failure;
|
|
3596
3739
|
}
|
|
3597
|
-
const
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3740
|
+
const finalized = await finalizeExportFile(tmp, opts.output, id, format, finalizeOps);
|
|
3741
|
+
if (!finalized.ok) {
|
|
3742
|
+
stopSpinner(false);
|
|
3743
|
+
const reason = errorReason(finalized.cause);
|
|
3744
|
+
if (finalized.preserved) {
|
|
3745
|
+
const guidance = finalized.state === "complete" ? `\uC548\uB0B4: API \uC7AC\uC870\uD68C\uAC00 \uD544\uC694 \uC5C6\uB294 \uC804\uCCB4 \uACB0\uACFC\uB97C ${finalized.recoveryPath} \uC5D0 \uB0A8\uACBC\uC2B5\uB2C8\uB2E4. \uADF8\uB300\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
3746
|
+
` : `\uC548\uB0B4: API \uC7AC\uC870\uD68C\uAC00 \uD544\uC694 \uC5C6\uB294 \uC804\uCCB4 \uB370\uC774\uD130\uB97C ${finalized.recoveryPath} \uC5D0 \uB0A8\uACBC\uC2B5\uB2C8\uB2E4. JSON \uBC30\uC5F4\uC758 \uB9C8\uC9C0\uB9C9 ]\uB97C \uD655\uC778\uD558\uC138\uC694.
|
|
3747
|
+
`;
|
|
3748
|
+
process.stderr.write(guidance);
|
|
3749
|
+
} else {
|
|
3750
|
+
process.stderr.write(
|
|
3751
|
+
`\uACBD\uACE0: \uBCF5\uAD6C \uD30C\uC77C ${finalized.recoveryPath} \uB85C \uC62E\uAE30\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uC784\uC2DC \uD30C\uC77C\uC744 \uC0AD\uC81C\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4: ${tmp}
|
|
3604
3752
|
`
|
|
3605
|
-
|
|
3606
|
-
|
|
3753
|
+
);
|
|
3754
|
+
}
|
|
3755
|
+
const message = finalized.state === "complete" ? `\uCD9C\uB825 \uD30C\uC77C \uCD5C\uC885 \uAD50\uCCB4\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4: ${opts.output} (${reason})` : `JSON \uBC30\uC5F4\uC744 \uB9C8\uBB34\uB9AC\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${opts.output} (${reason})`;
|
|
3756
|
+
throw new NhnCloudCliError(message, EXIT_PARAM_ERROR);
|
|
3607
3757
|
}
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
`
|
|
3614
|
-
);
|
|
3615
|
-
} else {
|
|
3758
|
+
stopSpinner(true, `${count}\uAC74 \uCD94\uCD9C \uC644\uB8CC`);
|
|
3759
|
+
await (0, import_promises5.rm)(`${opts.output}.partial`, { force: true }).catch(() => {
|
|
3760
|
+
});
|
|
3761
|
+
if (count >= MAX_TOTAL && (total > MAX_TOTAL || hasUnqueriedWindows)) {
|
|
3762
|
+
const totalDescription = hasUnqueriedWindows ? `\uC870\uD68C\uD55C \uCC3D\uC5D0\uC11C ${total}\uAC74\uC744 \uD655\uC778\uD588\uACE0 \uB0A8\uC740 \uCC3D\uC744 \uC870\uD68C\uD558\uC9C0 \uC54A\uC740 \uCC44` : `\uC804\uCCB4 ${total}\uAC74 \uC911`;
|
|
3616
3763
|
process.stderr.write(
|
|
3617
|
-
`\
|
|
3764
|
+
`\uACBD\uACE0: ${totalDescription} \uC0C1\uD55C ${MAX_TOTAL}\uAC74\uAE4C\uC9C0\uB9CC \uCD94\uCD9C\uD588\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9 \uBC94\uC704\uB97C \uC881\uD600 \uB098\uB220 \uCD94\uCD9C\uD558\uC138\uC694.
|
|
3618
3765
|
`
|
|
3619
3766
|
);
|
|
3620
3767
|
}
|
|
3621
|
-
|
|
3768
|
+
process.stderr.write(`${opts.output} \uC5D0 ${count}\uAC74 \uC800\uC7A5
|
|
3769
|
+
`);
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
var exportCommand = createExportCommand();
|
|
3773
|
+
async function finalizeExportFile(tmp, output2, id, format, ops = defaultExportFileOps) {
|
|
3774
|
+
if (format === "json") {
|
|
3775
|
+
try {
|
|
3776
|
+
await ops.appendFile(tmp, "]\n");
|
|
3777
|
+
} catch (cause) {
|
|
3778
|
+
return await preserveCompletedExport(tmp, output2, id, "unfinalized", cause, ops);
|
|
3779
|
+
}
|
|
3622
3780
|
}
|
|
3623
|
-
stopSpinner(true, `${count}\uAC74 \uCD94\uCD9C \uC644\uB8CC`);
|
|
3624
3781
|
try {
|
|
3625
|
-
await
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
const reason = err.code ?? (err instanceof Error ? err.message : String(err));
|
|
3630
|
-
throw new NhnCloudCliError(`\uCD9C\uB825 \uD30C\uC77C\uC744 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${opts.output} (${reason})`, EXIT_PARAM_ERROR);
|
|
3782
|
+
await ops.rename(tmp, output2);
|
|
3783
|
+
return { ok: true };
|
|
3784
|
+
} catch (cause) {
|
|
3785
|
+
return await preserveCompletedExport(tmp, output2, id, "complete", cause, ops);
|
|
3631
3786
|
}
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3787
|
+
}
|
|
3788
|
+
async function preserveCompletedExport(tmp, output2, id, state, cause, ops) {
|
|
3789
|
+
const recoveryPath = `${output2}.${id}.${state}`;
|
|
3790
|
+
try {
|
|
3791
|
+
await ops.rename(tmp, recoveryPath);
|
|
3792
|
+
return { ok: false, state, cause, recoveryPath, preserved: true };
|
|
3793
|
+
} catch {
|
|
3794
|
+
return { ok: false, state, cause, recoveryPath, preserved: false };
|
|
3640
3795
|
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3796
|
+
}
|
|
3797
|
+
function errorReason(error) {
|
|
3798
|
+
if (error instanceof Error) {
|
|
3799
|
+
return error.code ?? error.message;
|
|
3800
|
+
}
|
|
3801
|
+
return String(error);
|
|
3802
|
+
}
|
|
3644
3803
|
async function scrollNextWithHint(client, scrollKey) {
|
|
3645
3804
|
try {
|
|
3646
3805
|
return await client.scrollNext(scrollKey);
|
|
@@ -3664,8 +3823,37 @@ async function endAndClose(stream) {
|
|
|
3664
3823
|
});
|
|
3665
3824
|
}
|
|
3666
3825
|
|
|
3826
|
+
// src/commands/logncrash/available-token.ts
|
|
3827
|
+
var import_commander8 = require("commander");
|
|
3828
|
+
var availableTokenCommand = new import_commander8.Command("available-token").description("Log & Crash \uB0A8\uC740 \uC870\uD68C \uD1A0\uD070\uACFC \uCD94\uC815 \uB300\uAE30 \uC2DC\uAC04\uC744 \uD655\uC778").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3829
|
+
const opts = cmd.optsWithGlobals();
|
|
3830
|
+
const client = await resolveLogncrashClient(opts.profile);
|
|
3831
|
+
startSpinner("\uC870\uD68C \uD1A0\uD070 \uD655\uC778 \uC911...");
|
|
3832
|
+
let status;
|
|
3833
|
+
try {
|
|
3834
|
+
const result = await client.availableToken();
|
|
3835
|
+
status = availableTokenStatus(result.availableToken);
|
|
3836
|
+
} catch (err) {
|
|
3837
|
+
stopSpinner(false);
|
|
3838
|
+
throw err;
|
|
3839
|
+
}
|
|
3840
|
+
stopSpinner(true);
|
|
3841
|
+
output(opts, {
|
|
3842
|
+
headers: ["\uD56D\uBAA9", "\uAC12"],
|
|
3843
|
+
rows: [
|
|
3844
|
+
["\uB0A8\uC740 \uC870\uD68C \uD1A0\uD070", String(status.availableToken)],
|
|
3845
|
+
[
|
|
3846
|
+
"\uC591\uC218\uAE4C\uC9C0 \uCD94\uC815 \uB300\uAE30 \uC2DC\uAC04(\uCD08)",
|
|
3847
|
+
status.estimatedWaitSeconds === null ? "\uB300\uAE30 \uBD88\uD544\uC694" : String(status.estimatedWaitSeconds)
|
|
3848
|
+
]
|
|
3849
|
+
],
|
|
3850
|
+
raw: status,
|
|
3851
|
+
ids: [String(status.availableToken)]
|
|
3852
|
+
});
|
|
3853
|
+
});
|
|
3854
|
+
|
|
3667
3855
|
// src/commands/deploy/run.ts
|
|
3668
|
-
var
|
|
3856
|
+
var import_commander9 = require("commander");
|
|
3669
3857
|
|
|
3670
3858
|
// src/services/deploy/client.ts
|
|
3671
3859
|
var import_ky8 = __toESM(require("ky"));
|
|
@@ -3903,6 +4091,15 @@ var DeployClient = class {
|
|
|
3903
4091
|
}
|
|
3904
4092
|
};
|
|
3905
4093
|
|
|
4094
|
+
// src/commands/service-appkey.ts
|
|
4095
|
+
async function resolveServiceAppKey(service, profileName, missingMessage) {
|
|
4096
|
+
const credential = await getOptionalServiceCredential(service, profileName);
|
|
4097
|
+
if (!credential?.appkey) {
|
|
4098
|
+
throw new NhnCloudCliError(missingMessage, EXIT_CONFIG_ERROR);
|
|
4099
|
+
}
|
|
4100
|
+
return credential.appkey;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
3906
4103
|
// src/commands/deploy/helpers.ts
|
|
3907
4104
|
async function createDeployClient(profileOpt) {
|
|
3908
4105
|
const profileName = await resolveProfileName(profileOpt);
|
|
@@ -3910,17 +4107,29 @@ async function createDeployClient(profileOpt) {
|
|
|
3910
4107
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
3911
4108
|
return { client: new DeployClient(accessToken), profileName };
|
|
3912
4109
|
}
|
|
4110
|
+
async function resolveDeployAppKey(profileName) {
|
|
4111
|
+
return resolveServiceAppKey(
|
|
4112
|
+
"deploy",
|
|
4113
|
+
profileName,
|
|
4114
|
+
"Deploy appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.\nnhncloud configure --deploy-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694."
|
|
4115
|
+
);
|
|
4116
|
+
}
|
|
4117
|
+
function requireCoordinate(value, flag) {
|
|
4118
|
+
if (!value) {
|
|
4119
|
+
throw new NhnCloudCliError(`${flag} \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
4120
|
+
}
|
|
4121
|
+
return value;
|
|
4122
|
+
}
|
|
3913
4123
|
|
|
3914
4124
|
// src/commands/deploy/run.ts
|
|
3915
|
-
var runCommand = new
|
|
4125
|
+
var runCommand = new import_commander9.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
4126
|
const opts = cmd.optsWithGlobals();
|
|
3917
4127
|
const concurrentNum = parsePositiveIntegerOption(opts.concurrent ?? "1", "--concurrent");
|
|
3918
|
-
const
|
|
3919
|
-
const
|
|
3920
|
-
const
|
|
3921
|
-
const
|
|
3922
|
-
const
|
|
3923
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4128
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4129
|
+
const serverGroupId = requireCoordinate(opts.serverGroupId, "--server-group-id");
|
|
4130
|
+
const scenarioIds = requireCoordinate(opts.scenarioIds, "--scenario-ids");
|
|
4131
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4132
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
3924
4133
|
startSpinner("\uBC30\uD3EC \uC2E4\uD589 \uC911...");
|
|
3925
4134
|
let result;
|
|
3926
4135
|
try {
|
|
@@ -3949,22 +4158,11 @@ var runCommand = new import_commander7.Command("run").description("\uBC30\uD3EC\
|
|
|
3949
4158
|
});
|
|
3950
4159
|
|
|
3951
4160
|
// src/commands/deploy/artifacts.ts
|
|
3952
|
-
var
|
|
3953
|
-
var artifactsCommand = new
|
|
4161
|
+
var import_commander10 = require("commander");
|
|
4162
|
+
var artifactsCommand = new import_commander10.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
4163
|
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);
|
|
4164
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4165
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
3968
4166
|
startSpinner("\uC544\uD2F0\uD329\uD2B8 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
3969
4167
|
let result;
|
|
3970
4168
|
try {
|
|
@@ -3990,13 +4188,12 @@ var artifactsCommand = new import_commander8.Command("artifacts").description("\
|
|
|
3990
4188
|
});
|
|
3991
4189
|
|
|
3992
4190
|
// src/commands/deploy/server-groups.ts
|
|
3993
|
-
var
|
|
3994
|
-
var serverGroupsCommand = new
|
|
4191
|
+
var import_commander11 = require("commander");
|
|
4192
|
+
var serverGroupsCommand = new import_commander11.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
4193
|
const opts = cmd.optsWithGlobals();
|
|
3996
|
-
const
|
|
3997
|
-
const
|
|
3998
|
-
const
|
|
3999
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4194
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4195
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4196
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4000
4197
|
startSpinner("\uC11C\uBC84\uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4001
4198
|
let result;
|
|
4002
4199
|
try {
|
|
@@ -4015,13 +4212,12 @@ var serverGroupsCommand = new import_commander9.Command("server-groups").descrip
|
|
|
4015
4212
|
});
|
|
4016
4213
|
|
|
4017
4214
|
// src/commands/deploy/histories.ts
|
|
4018
|
-
var
|
|
4019
|
-
var historiesCommand = new
|
|
4215
|
+
var import_commander12 = require("commander");
|
|
4216
|
+
var historiesCommand = new import_commander12.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
4217
|
const opts = cmd.optsWithGlobals();
|
|
4021
|
-
const
|
|
4022
|
-
const
|
|
4023
|
-
const
|
|
4024
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4218
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4219
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4220
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4025
4221
|
startSpinner("\uBC30\uD3EC \uC774\uB825 \uC870\uD68C \uC911...");
|
|
4026
4222
|
let result;
|
|
4027
4223
|
try {
|
|
@@ -4040,13 +4236,12 @@ var historiesCommand = new import_commander10.Command("histories").description("
|
|
|
4040
4236
|
});
|
|
4041
4237
|
|
|
4042
4238
|
// src/commands/deploy/binary-groups.ts
|
|
4043
|
-
var
|
|
4044
|
-
var binaryGroupsCommand = new
|
|
4239
|
+
var import_commander13 = require("commander");
|
|
4240
|
+
var binaryGroupsCommand = new import_commander13.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
4241
|
const opts = cmd.optsWithGlobals();
|
|
4046
|
-
const
|
|
4047
|
-
const
|
|
4048
|
-
const
|
|
4049
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4242
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4243
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4244
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4050
4245
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4051
4246
|
let groups;
|
|
4052
4247
|
try {
|
|
@@ -4073,7 +4268,7 @@ var binaryGroupsCommand = new import_commander11.Command("binary-groups").descri
|
|
|
4073
4268
|
});
|
|
4074
4269
|
|
|
4075
4270
|
// src/commands/deploy/binaries.ts
|
|
4076
|
-
var
|
|
4271
|
+
var import_commander14 = require("commander");
|
|
4077
4272
|
function parsePositiveInt(value, flag) {
|
|
4078
4273
|
if (value === void 0) return void 0;
|
|
4079
4274
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -4084,7 +4279,7 @@ function parsePositiveInt(value, flag) {
|
|
|
4084
4279
|
}
|
|
4085
4280
|
return Number(value);
|
|
4086
4281
|
}
|
|
4087
|
-
var binariesCommand = new
|
|
4282
|
+
var binariesCommand = new import_commander14.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
4283
|
const opts = cmd.optsWithGlobals();
|
|
4089
4284
|
const binaryGroupKey = parsePositiveInt(opts.binaryGroup, "--binary-group");
|
|
4090
4285
|
if (binaryGroupKey === void 0) {
|
|
@@ -4092,10 +4287,9 @@ var binariesCommand = new import_commander12.Command("binaries").description("\u
|
|
|
4092
4287
|
}
|
|
4093
4288
|
const pageNum = parsePositiveInt(opts.pageNum, "--page-num");
|
|
4094
4289
|
const pageSize = parsePositiveInt(opts.pageSize, "--page-size");
|
|
4095
|
-
const
|
|
4096
|
-
const
|
|
4097
|
-
const
|
|
4098
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4290
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4291
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4292
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4099
4293
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4100
4294
|
let result;
|
|
4101
4295
|
try {
|
|
@@ -4129,7 +4323,7 @@ var binariesCommand = new import_commander12.Command("binaries").description("\u
|
|
|
4129
4323
|
});
|
|
4130
4324
|
|
|
4131
4325
|
// src/commands/deploy/upload.ts
|
|
4132
|
-
var
|
|
4326
|
+
var import_commander15 = require("commander");
|
|
4133
4327
|
var import_node_fs5 = require("fs");
|
|
4134
4328
|
var import_node_path7 = require("path");
|
|
4135
4329
|
var MAX_UPLOAD_BYTES = 512 * 1024 * 1024;
|
|
@@ -4143,12 +4337,13 @@ function parsePositiveInt2(value, flag) {
|
|
|
4143
4337
|
}
|
|
4144
4338
|
return Number(value);
|
|
4145
4339
|
}
|
|
4146
|
-
var uploadCommand = new
|
|
4340
|
+
var uploadCommand = new import_commander15.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
4341
|
const opts = cmd.optsWithGlobals();
|
|
4148
4342
|
const binaryGroupKey = parsePositiveInt2(opts.binaryGroup, "--binary-group");
|
|
4149
4343
|
if (binaryGroupKey === void 0) {
|
|
4150
4344
|
throw new NhnCloudCliError("--binary-group \uC774 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
4151
4345
|
}
|
|
4346
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4152
4347
|
const filePath = opts.file;
|
|
4153
4348
|
let stat3;
|
|
4154
4349
|
try {
|
|
@@ -4171,10 +4366,8 @@ var uploadCommand = new import_commander13.Command("upload").description("\uB85C
|
|
|
4171
4366
|
}
|
|
4172
4367
|
const fileBuffer = (0, import_node_fs5.readFileSync)(filePath);
|
|
4173
4368
|
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);
|
|
4369
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4370
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4178
4371
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uC5C5\uB85C\uB4DC \uC911...");
|
|
4179
4372
|
let result;
|
|
4180
4373
|
try {
|
|
@@ -4205,9 +4398,9 @@ var uploadCommand = new import_commander13.Command("upload").description("\uB85C
|
|
|
4205
4398
|
});
|
|
4206
4399
|
|
|
4207
4400
|
// src/commands/deploy/download.ts
|
|
4208
|
-
var
|
|
4401
|
+
var import_commander16 = require("commander");
|
|
4209
4402
|
var import_node_fs6 = require("fs");
|
|
4210
|
-
var
|
|
4403
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
4211
4404
|
function parsePositiveInt3(value, flag) {
|
|
4212
4405
|
if (value === void 0) return void 0;
|
|
4213
4406
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -4235,19 +4428,18 @@ function assertWritable2(path5, force) {
|
|
|
4235
4428
|
EXIT_PARAM_ERROR
|
|
4236
4429
|
);
|
|
4237
4430
|
}
|
|
4238
|
-
var downloadCommand = new
|
|
4431
|
+
var downloadCommand = new import_commander16.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
4432
|
const opts = cmd.optsWithGlobals();
|
|
4240
4433
|
const binaryGroupKey = parsePositiveInt3(opts.binaryGroup, "--binary-group");
|
|
4241
4434
|
const binaryKey = parsePositiveInt3(opts.binaryKey, "--binary-key");
|
|
4242
4435
|
if (binaryGroupKey === void 0 || binaryKey === void 0) {
|
|
4243
4436
|
throw new NhnCloudCliError("--binary-group / --binary-key \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
4244
4437
|
}
|
|
4438
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4245
4439
|
const outPath = opts.output;
|
|
4246
4440
|
assertWritable2(outPath, opts.force ?? false);
|
|
4247
|
-
const
|
|
4248
|
-
const appKey =
|
|
4249
|
-
const artifactId = opts.artifactId ?? target.artifactId;
|
|
4250
|
-
const { client } = await createDeployClient(opts.profile);
|
|
4441
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4442
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4251
4443
|
startSpinner("\uBC14\uC774\uB108\uB9AC \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
4252
4444
|
try {
|
|
4253
4445
|
const buffer = await client.downloadBinary(appKey, artifactId, binaryGroupKey, binaryKey);
|
|
@@ -4258,13 +4450,13 @@ var downloadCommand = new import_commander14.Command("download").description("\u
|
|
|
4258
4450
|
}
|
|
4259
4451
|
stopSpinner(true);
|
|
4260
4452
|
if (!opts.quiet) {
|
|
4261
|
-
process.stderr.write(
|
|
4453
|
+
process.stderr.write(import_chalk4.default.green(` \uC800\uC7A5\uB428: ${outPath}
|
|
4262
4454
|
`));
|
|
4263
4455
|
}
|
|
4264
4456
|
});
|
|
4265
4457
|
|
|
4266
4458
|
// src/commands/instance/list.ts
|
|
4267
|
-
var
|
|
4459
|
+
var import_commander17 = require("commander");
|
|
4268
4460
|
|
|
4269
4461
|
// src/commands/iaas.ts
|
|
4270
4462
|
async function resolveIaasTokenContext(opts) {
|
|
@@ -4829,7 +5021,7 @@ async function resolveInstanceClient(opts) {
|
|
|
4829
5021
|
function getIps(server) {
|
|
4830
5022
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
4831
5023
|
}
|
|
4832
|
-
var listCommand = new
|
|
5024
|
+
var listCommand = new import_commander17.Command("list").description("\uC778\uC2A4\uD134\uC2A4 \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) => {
|
|
4833
5025
|
const opts = cmd.optsWithGlobals();
|
|
4834
5026
|
const { client } = await resolveInstanceClient(opts);
|
|
4835
5027
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -4850,7 +5042,7 @@ var listCommand = new import_commander15.Command("list").description("\uC778\uC2
|
|
|
4850
5042
|
});
|
|
4851
5043
|
|
|
4852
5044
|
// src/commands/volume/list.ts
|
|
4853
|
-
var
|
|
5045
|
+
var import_commander18 = require("commander");
|
|
4854
5046
|
|
|
4855
5047
|
// src/services/blockstorage/client.ts
|
|
4856
5048
|
var import_ky10 = __toESM(require("ky"));
|
|
@@ -4968,7 +5160,7 @@ function parsePositiveInt4(value, flag) {
|
|
|
4968
5160
|
}
|
|
4969
5161
|
return Number(value);
|
|
4970
5162
|
}
|
|
4971
|
-
var listCommand2 = new
|
|
5163
|
+
var listCommand2 = new import_commander18.Command("list").description("\uBCFC\uB968 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--sort <key:dir>", "\uC815\uB82C \uAE30\uC900 (\uC608: created_at:desc)").option("--limit <n>", "\uCD5C\uB300 \uBC18\uD658 \uAC1C\uC218").option("--offset <n>", "\uD398\uC774\uC9C0 \uC2DC\uC791 \uC624\uD504\uC14B").option("--marker <id>", "\uD398\uC774\uC9C0\uB124\uC774\uC158 \uB9C8\uCEE4 \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 (_opts, cmd) => {
|
|
4972
5164
|
const opts = cmd.optsWithGlobals();
|
|
4973
5165
|
const limitNum = opts.limit !== void 0 ? parsePositiveInt4(opts.limit, "--limit") : void 0;
|
|
4974
5166
|
const offsetNum = opts.offset !== void 0 ? parsePositiveInt4(opts.offset, "--offset") : void 0;
|
|
@@ -5002,8 +5194,8 @@ var listCommand2 = new import_commander16.Command("list").description("\uBCFC\uB
|
|
|
5002
5194
|
});
|
|
5003
5195
|
|
|
5004
5196
|
// src/commands/volume/get.ts
|
|
5005
|
-
var
|
|
5006
|
-
var getCommand = new
|
|
5197
|
+
var import_commander19 = require("commander");
|
|
5198
|
+
var getCommand = new import_commander19.Command("get").description("\uB2E8\uC77C \uBCFC\uB968 \uC0C1\uD0DC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "\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) => {
|
|
5007
5199
|
const opts = cmd.optsWithGlobals();
|
|
5008
5200
|
const { client } = await resolveVolumeClient(opts);
|
|
5009
5201
|
startSpinner("\uBCFC\uB968 \uC870\uD68C \uC911...");
|
|
@@ -5034,9 +5226,9 @@ var getCommand = new import_commander17.Command("get").description("\uB2E8\uC77C
|
|
|
5034
5226
|
});
|
|
5035
5227
|
|
|
5036
5228
|
// src/commands/volume/create.ts
|
|
5037
|
-
var
|
|
5038
|
-
var
|
|
5039
|
-
var createCommand = new
|
|
5229
|
+
var import_commander20 = require("commander");
|
|
5230
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
5231
|
+
var createCommand = new import_commander20.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
5232
|
const opts = cmd.optsWithGlobals();
|
|
5041
5233
|
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
5042
5234
|
throw new NhnCloudCliError(
|
|
@@ -5069,7 +5261,7 @@ var createCommand = new import_commander18.Command("create").description("\uBCFC
|
|
|
5069
5261
|
throw err;
|
|
5070
5262
|
}
|
|
5071
5263
|
stopSpinner(true);
|
|
5072
|
-
process.stderr.write(
|
|
5264
|
+
process.stderr.write(import_chalk5.default.green(`\uBCFC\uB968 \uBC1C\uAE09 \uC694\uCCAD \uC644\uB8CC (id: ${volume.id}, status: ${volume.status})
|
|
5073
5265
|
`));
|
|
5074
5266
|
const rows = [
|
|
5075
5267
|
["id", volume.id],
|
|
@@ -5089,7 +5281,7 @@ var createCommand = new import_commander18.Command("create").description("\uBCFC
|
|
|
5089
5281
|
});
|
|
5090
5282
|
|
|
5091
5283
|
// src/commands/network/list.ts
|
|
5092
|
-
var
|
|
5284
|
+
var import_commander21 = require("commander");
|
|
5093
5285
|
|
|
5094
5286
|
// src/services/network/client.ts
|
|
5095
5287
|
var import_ky11 = __toESM(require("ky"));
|
|
@@ -5268,7 +5460,7 @@ async function resolveNetworkClient(opts) {
|
|
|
5268
5460
|
}
|
|
5269
5461
|
|
|
5270
5462
|
// src/commands/network/list.ts
|
|
5271
|
-
var listCommand3 = new
|
|
5463
|
+
var listCommand3 = new import_commander21.Command("list").description("VPC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").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) => {
|
|
5272
5464
|
const opts = cmd.optsWithGlobals();
|
|
5273
5465
|
const { client } = await resolveNetworkClient(opts);
|
|
5274
5466
|
startSpinner("VPC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5289,8 +5481,8 @@ var listCommand3 = new import_commander19.Command("list").description("VPC \uBAA
|
|
|
5289
5481
|
});
|
|
5290
5482
|
|
|
5291
5483
|
// src/commands/network/subnet.ts
|
|
5292
|
-
var
|
|
5293
|
-
var subnetListCommand = new
|
|
5484
|
+
var import_commander22 = require("commander");
|
|
5485
|
+
var subnetListCommand = new import_commander22.Command("list").description("\uC11C\uBE0C\uB137 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").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) => {
|
|
5294
5486
|
const opts = cmd.optsWithGlobals();
|
|
5295
5487
|
const { client } = await resolveNetworkClient(opts);
|
|
5296
5488
|
startSpinner("\uC11C\uBE0C\uB137 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5315,11 +5507,11 @@ var subnetListCommand = new import_commander20.Command("list").description("\uC1
|
|
|
5315
5507
|
ids: subnets.map((s) => s.id)
|
|
5316
5508
|
});
|
|
5317
5509
|
});
|
|
5318
|
-
var subnetCommand = new
|
|
5510
|
+
var subnetCommand = new import_commander22.Command("subnet").description("\uC11C\uBE0C\uB137 \uAD00\uB828 \uBA85\uB839").addCommand(subnetListCommand);
|
|
5319
5511
|
|
|
5320
5512
|
// src/commands/floatingip/list.ts
|
|
5321
|
-
var
|
|
5322
|
-
var listCommand4 = new
|
|
5513
|
+
var import_commander23 = require("commander");
|
|
5514
|
+
var listCommand4 = new import_commander23.Command("list").description("Floating IP \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) => {
|
|
5323
5515
|
const opts = cmd.optsWithGlobals();
|
|
5324
5516
|
const { client } = await resolveNetworkClient(opts);
|
|
5325
5517
|
startSpinner("Floating IP \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5346,9 +5538,9 @@ var listCommand4 = new import_commander21.Command("list").description("Floating
|
|
|
5346
5538
|
});
|
|
5347
5539
|
|
|
5348
5540
|
// src/commands/floatingip/create.ts
|
|
5349
|
-
var
|
|
5350
|
-
var
|
|
5351
|
-
var createCommand2 = new
|
|
5541
|
+
var import_commander24 = require("commander");
|
|
5542
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
5543
|
+
var createCommand2 = new import_commander24.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
5544
|
const opts = cmd.optsWithGlobals();
|
|
5353
5545
|
const { client } = await resolveNetworkClient(opts);
|
|
5354
5546
|
let networkId = opts.network;
|
|
@@ -5379,7 +5571,7 @@ var createCommand2 = new import_commander22.Command("create").description("Float
|
|
|
5379
5571
|
}
|
|
5380
5572
|
stopSpinner(true);
|
|
5381
5573
|
process.stderr.write(
|
|
5382
|
-
|
|
5574
|
+
import_chalk6.default.green(`\u2713 Floating IP "${fip.floating_ip_address}" \uB97C \uBC1C\uAE09\uD588\uC2B5\uB2C8\uB2E4 (id: ${fip.id}).
|
|
5383
5575
|
`)
|
|
5384
5576
|
);
|
|
5385
5577
|
output(opts, {
|
|
@@ -5391,9 +5583,9 @@ var createCommand2 = new import_commander22.Command("create").description("Float
|
|
|
5391
5583
|
});
|
|
5392
5584
|
|
|
5393
5585
|
// src/commands/floatingip/delete.ts
|
|
5394
|
-
var
|
|
5395
|
-
var
|
|
5396
|
-
var deleteCommand = new
|
|
5586
|
+
var import_commander25 = require("commander");
|
|
5587
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
5588
|
+
var deleteCommand = new import_commander25.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
5589
|
const opts = cmd.optsWithGlobals();
|
|
5398
5590
|
const isTTY = process.stdin.isTTY;
|
|
5399
5591
|
if (!isTTY && !opts.yes) {
|
|
@@ -5409,7 +5601,7 @@ var deleteCommand = new import_commander23.Command("delete").description("Floati
|
|
|
5409
5601
|
default: false
|
|
5410
5602
|
});
|
|
5411
5603
|
if (!ok) {
|
|
5412
|
-
process.stderr.write(
|
|
5604
|
+
process.stderr.write(import_chalk7.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
5413
5605
|
return;
|
|
5414
5606
|
}
|
|
5415
5607
|
}
|
|
@@ -5422,13 +5614,13 @@ var deleteCommand = new import_commander23.Command("delete").description("Floati
|
|
|
5422
5614
|
throw err;
|
|
5423
5615
|
}
|
|
5424
5616
|
stopSpinner(true);
|
|
5425
|
-
process.stderr.write(
|
|
5617
|
+
process.stderr.write(import_chalk7.default.green(`\u2713 Floating IP "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5426
5618
|
`));
|
|
5427
5619
|
});
|
|
5428
5620
|
|
|
5429
5621
|
// src/commands/instance/flavors.ts
|
|
5430
|
-
var
|
|
5431
|
-
var flavorsCommand = new
|
|
5622
|
+
var import_commander26 = require("commander");
|
|
5623
|
+
var flavorsCommand = new import_commander26.Command("flavors").description("\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785(flavor)\uC744 \uC870\uD68C\uD55C\uB2E4 (\uAE30\uBCF8 id\xB7name, --detail \uB85C \uC2A4\uD399, \uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--detail", "vcpus\xB7ram\xB7disk \uB4F1 \uC2A4\uD399 \uD3EC\uD568 (GET /flavors/detail)").option("--min-disk <gb>", "\uCD5C\uC18C \uBE14\uB85D \uC2A4\uD1A0\uB9AC\uC9C0 \uD06C\uAE30(GB) \uC774\uC0C1\uB9CC \uD544\uD130").option("--min-ram <mb>", "\uCD5C\uC18C RAM \uD06C\uAE30(MB) \uC774\uC0C1\uB9CC \uD544\uD130").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) => {
|
|
5432
5624
|
const opts = cmd.optsWithGlobals();
|
|
5433
5625
|
const minDisk = parseNonNegativeIntegerOption(opts.minDisk, "--min-disk");
|
|
5434
5626
|
const minRam = parseNonNegativeIntegerOption(opts.minRam, "--min-ram");
|
|
@@ -5471,8 +5663,8 @@ function isDetailList(flavors) {
|
|
|
5471
5663
|
}
|
|
5472
5664
|
|
|
5473
5665
|
// src/commands/instance/availability-zones.ts
|
|
5474
|
-
var
|
|
5475
|
-
var availabilityZonesCommand = new
|
|
5666
|
+
var import_commander27 = require("commander");
|
|
5667
|
+
var availabilityZonesCommand = new import_commander27.Command("availability-zones").description("\uAC00\uC6A9\uC131 \uC601\uC5ED(availability zone) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (zoneName\xB7available)").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) => {
|
|
5476
5668
|
const opts = cmd.optsWithGlobals();
|
|
5477
5669
|
const { client } = await resolveInstanceClient(opts);
|
|
5478
5670
|
startSpinner("\uAC00\uC6A9\uC131 \uC601\uC5ED \uC870\uD68C \uC911...");
|
|
@@ -5493,14 +5685,14 @@ var availabilityZonesCommand = new import_commander25.Command("availability-zone
|
|
|
5493
5685
|
});
|
|
5494
5686
|
|
|
5495
5687
|
// src/commands/instance/get.ts
|
|
5496
|
-
var
|
|
5688
|
+
var import_commander28 = require("commander");
|
|
5497
5689
|
function getIps2(server) {
|
|
5498
5690
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
5499
5691
|
}
|
|
5500
5692
|
function getImageId(server) {
|
|
5501
5693
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5502
5694
|
}
|
|
5503
|
-
var getCommand2 = new
|
|
5695
|
+
var getCommand2 = new import_commander28.Command("get").description("\uB2E8\uC77C \uC778\uC2A4\uD134\uC2A4 \uC0C1\uD0DC\uB97C \uC870\uD68C\uD55C\uB2E4").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) => {
|
|
5504
5696
|
const opts = cmd.optsWithGlobals();
|
|
5505
5697
|
const { client } = await resolveInstanceClient(opts);
|
|
5506
5698
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uC870\uD68C \uC911...");
|
|
@@ -5532,9 +5724,9 @@ var getCommand2 = new import_commander26.Command("get").description("\uB2E8\uC77
|
|
|
5532
5724
|
});
|
|
5533
5725
|
|
|
5534
5726
|
// src/commands/instance/create.ts
|
|
5535
|
-
var
|
|
5727
|
+
var import_commander29 = require("commander");
|
|
5536
5728
|
var import_node_fs7 = require("fs");
|
|
5537
|
-
var
|
|
5729
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
5538
5730
|
function getFirstIp(server) {
|
|
5539
5731
|
for (const list of Object.values(server.addresses)) {
|
|
5540
5732
|
for (const addr of list) {
|
|
@@ -5549,7 +5741,7 @@ function getIps3(server) {
|
|
|
5549
5741
|
function getImageId2(server) {
|
|
5550
5742
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5551
5743
|
}
|
|
5552
|
-
var createCommand3 = new
|
|
5744
|
+
var createCommand3 = new import_commander29.Command("create").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC0DD\uC131\uD55C\uB2E4").requiredOption("--name <name>", "\uC778\uC2A4\uD134\uC2A4 \uC774\uB984").requiredOption("--flavor <id>", "flavor ID").requiredOption("--image <id>", "\uC774\uBBF8\uC9C0 ID").requiredOption("--network <uuid>", "\uB124\uD2B8\uC6CC\uD06C UUID (\uC5EC\uB7EC \uAC1C: \uBC18\uBCF5 \uC9C0\uC815)", (v, prev) => [...prev, v], []).option("--boot-volume-size <gb>", "boot-from-volume root \uBCFC\uB968 \uD06C\uAE30 (GB). GPU(g2) \uB4F1 boot-from-volume \uD544\uC218 flavor \uC5D0 \uC9C0\uC815").option("--key-name <name>", "\uD0A4\uD398\uC5B4 \uC774\uB984").option("--security-group <name>", "\uBCF4\uC548 \uADF8\uB8F9 \uC774\uB984 (\uC5EC\uB7EC \uAC1C: \uBC18\uBCF5 \uC9C0\uC815)", (v, prev) => [...prev, v], []).option("--ephemeral-disk-size <gb>", "\uC784\uC2DC \uB514\uC2A4\uD06C \uD06C\uAE30 (GB, NHN \uD655\uC7A5)").option("--protect", "\uC0AD\uC81C \uBC29\uC9C0 \uC124\uC815 (NHN \uD655\uC7A5)").option("--user-data <path>", "cloud-init user-data \uD30C\uC77C \uACBD\uB85C (base64 \uC778\uCF54\uB529\uD574 \uC8FC\uC785, \uC778\uCF54\uB529 \uD6C4 65535 \uBC14\uC774\uD2B8 \uD55C\uB3C4)").option("--wait", "ACTIVE \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>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5553
5745
|
const opts = cmd.optsWithGlobals();
|
|
5554
5746
|
const networks = opts.network ?? [];
|
|
5555
5747
|
if (networks.length === 0) {
|
|
@@ -5628,7 +5820,7 @@ var createCommand3 = new import_commander27.Command("create").description("\uC77
|
|
|
5628
5820
|
return;
|
|
5629
5821
|
}
|
|
5630
5822
|
if (opts.wait) {
|
|
5631
|
-
process.stderr.write(
|
|
5823
|
+
process.stderr.write(import_chalk8.default.green(` IP: ${getIps3(server)}
|
|
5632
5824
|
`));
|
|
5633
5825
|
}
|
|
5634
5826
|
const rows = [
|
|
@@ -5648,9 +5840,9 @@ var createCommand3 = new import_commander27.Command("create").description("\uC77
|
|
|
5648
5840
|
});
|
|
5649
5841
|
|
|
5650
5842
|
// src/commands/instance/delete.ts
|
|
5651
|
-
var
|
|
5652
|
-
var
|
|
5653
|
-
var deleteCommand2 = new
|
|
5843
|
+
var import_commander30 = require("commander");
|
|
5844
|
+
var import_chalk9 = __toESM(require("chalk"));
|
|
5845
|
+
var deleteCommand2 = new import_commander30.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
5846
|
const opts = cmd.optsWithGlobals();
|
|
5655
5847
|
const isTTY = process.stdin.isTTY;
|
|
5656
5848
|
if (!isTTY && !opts.yes) {
|
|
@@ -5666,7 +5858,7 @@ var deleteCommand2 = new import_commander28.Command("delete").description("\uC77
|
|
|
5666
5858
|
default: false
|
|
5667
5859
|
});
|
|
5668
5860
|
if (!ok) {
|
|
5669
|
-
process.stderr.write(
|
|
5861
|
+
process.stderr.write(import_chalk9.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
5670
5862
|
return;
|
|
5671
5863
|
}
|
|
5672
5864
|
}
|
|
@@ -5679,14 +5871,14 @@ var deleteCommand2 = new import_commander28.Command("delete").description("\uC77
|
|
|
5679
5871
|
throw err;
|
|
5680
5872
|
}
|
|
5681
5873
|
stopSpinner(true);
|
|
5682
|
-
process.stderr.write(
|
|
5874
|
+
process.stderr.write(import_chalk9.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5683
5875
|
`));
|
|
5684
5876
|
});
|
|
5685
5877
|
|
|
5686
5878
|
// src/commands/instance/power.ts
|
|
5687
|
-
var
|
|
5688
|
-
var
|
|
5689
|
-
var startCommand = new
|
|
5879
|
+
var import_commander31 = require("commander");
|
|
5880
|
+
var import_chalk10 = __toESM(require("chalk"));
|
|
5881
|
+
var startCommand = new import_commander31.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
5882
|
const opts = cmd.optsWithGlobals();
|
|
5691
5883
|
const { client } = await resolveInstanceClient(opts);
|
|
5692
5884
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC2DC\uC791 \uC911... (id: ${id})`);
|
|
@@ -5697,10 +5889,10 @@ var startCommand = new import_commander29.Command("start").description("\uC778\u
|
|
|
5697
5889
|
throw err;
|
|
5698
5890
|
}
|
|
5699
5891
|
stopSpinner(true);
|
|
5700
|
-
process.stderr.write(
|
|
5892
|
+
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
5893
|
`));
|
|
5702
5894
|
});
|
|
5703
|
-
var stopCommand = new
|
|
5895
|
+
var stopCommand = new import_commander31.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) => {
|
|
5704
5896
|
const opts = cmd.optsWithGlobals();
|
|
5705
5897
|
const { client } = await resolveInstanceClient(opts);
|
|
5706
5898
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC815\uC9C0 \uC911... (id: ${id})`);
|
|
@@ -5711,10 +5903,10 @@ var stopCommand = new import_commander29.Command("stop").description("\uC778\uC2
|
|
|
5711
5903
|
throw err;
|
|
5712
5904
|
}
|
|
5713
5905
|
stopSpinner(true);
|
|
5714
|
-
process.stderr.write(
|
|
5906
|
+
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
5907
|
`));
|
|
5716
5908
|
});
|
|
5717
|
-
var rebootCommand = new
|
|
5909
|
+
var rebootCommand = new import_commander31.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) => {
|
|
5718
5910
|
const opts = cmd.optsWithGlobals();
|
|
5719
5911
|
const { client } = await resolveInstanceClient(opts);
|
|
5720
5912
|
const type = opts.hard ? "HARD" : "SOFT";
|
|
@@ -5726,14 +5918,14 @@ var rebootCommand = new import_commander29.Command("reboot").description("\uC778
|
|
|
5726
5918
|
throw err;
|
|
5727
5919
|
}
|
|
5728
5920
|
stopSpinner(true);
|
|
5729
|
-
process.stderr.write(
|
|
5921
|
+
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
5922
|
`));
|
|
5731
5923
|
});
|
|
5732
5924
|
|
|
5733
5925
|
// src/commands/instance/resize.ts
|
|
5734
|
-
var
|
|
5735
|
-
var
|
|
5736
|
-
var resizeCommand = new
|
|
5926
|
+
var import_commander32 = require("commander");
|
|
5927
|
+
var import_chalk11 = __toESM(require("chalk"));
|
|
5928
|
+
var resizeCommand = new import_commander32.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
5929
|
const opts = cmd.optsWithGlobals();
|
|
5738
5930
|
const { client } = await resolveInstanceClient(opts);
|
|
5739
5931
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785 \uBCC0\uACBD \uC911... (id: ${id})`);
|
|
@@ -5745,13 +5937,13 @@ var resizeCommand = new import_commander30.Command("resize").description("\uC778
|
|
|
5745
5937
|
}
|
|
5746
5938
|
stopSpinner(true);
|
|
5747
5939
|
process.stderr.write(
|
|
5748
|
-
|
|
5940
|
+
import_chalk11.default.green(
|
|
5749
5941
|
`\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
5942
|
`
|
|
5751
5943
|
)
|
|
5752
5944
|
);
|
|
5753
5945
|
});
|
|
5754
|
-
var resizeConfirmCommand = new
|
|
5946
|
+
var resizeConfirmCommand = new import_commander32.Command("resize-confirm").description("resize \uB97C \uD655\uC815\uD55C\uB2E4 (VERIFY_RESIZE \u2192 ACTIVE, \uC0C8 flavor \uB85C \uACE0\uC815)").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) => {
|
|
5755
5947
|
const opts = cmd.optsWithGlobals();
|
|
5756
5948
|
const { client } = await resolveInstanceClient(opts);
|
|
5757
5949
|
startSpinner(`resize \uD655\uC815 \uC911... (id: ${id})`);
|
|
@@ -5762,10 +5954,10 @@ var resizeConfirmCommand = new import_commander30.Command("resize-confirm").desc
|
|
|
5762
5954
|
throw err;
|
|
5763
5955
|
}
|
|
5764
5956
|
stopSpinner(true);
|
|
5765
|
-
process.stderr.write(
|
|
5957
|
+
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
5958
|
`));
|
|
5767
5959
|
});
|
|
5768
|
-
var resizeRevertCommand = new
|
|
5960
|
+
var resizeRevertCommand = new import_commander32.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) => {
|
|
5769
5961
|
const opts = cmd.optsWithGlobals();
|
|
5770
5962
|
const { client } = await resolveInstanceClient(opts);
|
|
5771
5963
|
startSpinner(`resize \uB864\uBC31 \uC911... (id: ${id})`);
|
|
@@ -5777,15 +5969,15 @@ var resizeRevertCommand = new import_commander30.Command("resize-revert").descri
|
|
|
5777
5969
|
}
|
|
5778
5970
|
stopSpinner(true);
|
|
5779
5971
|
process.stderr.write(
|
|
5780
|
-
|
|
5972
|
+
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
5973
|
`)
|
|
5782
5974
|
);
|
|
5783
5975
|
});
|
|
5784
5976
|
|
|
5785
5977
|
// src/commands/instance/images.ts
|
|
5786
|
-
var
|
|
5978
|
+
var import_commander33 = require("commander");
|
|
5787
5979
|
var VISIBILITY_VALUES = ["public", "private", "shared"];
|
|
5788
|
-
var imagesCommand = new
|
|
5980
|
+
var imagesCommand = new import_commander33.Command("images").description("\uC774\uBBF8\uC9C0 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (create --image <id> \uC18C\uC2A4, \uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--limit <n>", "\uD55C \uD398\uC774\uC9C0 \uCD5C\uB300 \uAC1C\uC218 (\uAE30\uBCF8: \uC11C\uBC84 \uAE30\uBCF8\uAC12 25)").option("--marker <id>", "\uC774 image id \uB2E4\uC74C\uBD80\uD130 \uC870\uD68C (\uD398\uC774\uC9C0\uB124\uC774\uC158)").option("--name <name>", "\uC774\uB984\uC73C\uB85C \uD544\uD130").option("--visibility <v>", `\uB178\uCD9C \uBC94\uC704 \uD544\uD130 (${VISIBILITY_VALUES.join("|")})`).option("--owner <id>", "\uC18C\uC720\uC790(\uD504\uB85C\uC81D\uD2B8 id)\uB85C \uD544\uD130").option("--status <status>", "\uC0C1\uD0DC\uB85C \uD544\uD130 (\uC608: active)").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) => {
|
|
5789
5981
|
const opts = cmd.optsWithGlobals();
|
|
5790
5982
|
const limit = parsePositiveIntegerOption(opts.limit, "--limit");
|
|
5791
5983
|
if (opts.visibility !== void 0 && !VISIBILITY_VALUES.includes(opts.visibility)) {
|
|
@@ -5833,8 +6025,8 @@ var imagesCommand = new import_commander31.Command("images").description("\uC774
|
|
|
5833
6025
|
});
|
|
5834
6026
|
|
|
5835
6027
|
// src/commands/instance/keypairs.ts
|
|
5836
|
-
var
|
|
5837
|
-
var keypairsCommand = new
|
|
6028
|
+
var import_commander34 = require("commander");
|
|
6029
|
+
var keypairsCommand = new import_commander34.Command("keypairs").description("\uD0A4\uD398\uC5B4 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (name\xB7fingerprint, \uC804\uCCB4 \uD544\uB4DC\uB294 --json)").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) => {
|
|
5838
6030
|
const opts = cmd.optsWithGlobals();
|
|
5839
6031
|
const { client } = await resolveInstanceClient(opts);
|
|
5840
6032
|
startSpinner("\uD0A4\uD398\uC5B4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5855,10 +6047,10 @@ var keypairsCommand = new import_commander32.Command("keypairs").description("\u
|
|
|
5855
6047
|
});
|
|
5856
6048
|
|
|
5857
6049
|
// src/commands/instance/keypair.ts
|
|
5858
|
-
var
|
|
6050
|
+
var import_commander35 = require("commander");
|
|
5859
6051
|
var import_node_fs8 = require("fs");
|
|
5860
6052
|
var import_node_crypto5 = require("crypto");
|
|
5861
|
-
var
|
|
6053
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
5862
6054
|
function resolvePublicKey(value) {
|
|
5863
6055
|
let stat3;
|
|
5864
6056
|
try {
|
|
@@ -5898,7 +6090,7 @@ function savePrivateKey(filePath, privateKey) {
|
|
|
5898
6090
|
);
|
|
5899
6091
|
}
|
|
5900
6092
|
}
|
|
5901
|
-
var getKeypairCmd = new
|
|
6093
|
+
var getKeypairCmd = new import_commander35.Command("get").description("\uB2E8\uC77C \uD0A4\uD398\uC5B4\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<name>", "\uD0A4\uD398\uC5B4 \uC774\uB984").option("--region <region>", "region override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (name, _opts, cmd) => {
|
|
5902
6094
|
const opts = cmd.optsWithGlobals();
|
|
5903
6095
|
const { client } = await resolveInstanceClient(opts);
|
|
5904
6096
|
startSpinner("\uD0A4\uD398\uC5B4 \uC870\uD68C \uC911...");
|
|
@@ -5923,7 +6115,7 @@ var getKeypairCmd = new import_commander33.Command("get").description("\uB2E8\uC
|
|
|
5923
6115
|
ids: [kp.name]
|
|
5924
6116
|
});
|
|
5925
6117
|
});
|
|
5926
|
-
var createKeypairCmd = new
|
|
6118
|
+
var createKeypairCmd = new import_commander35.Command("create").description("\uD0A4\uD398\uC5B4\uB97C \uC0DD\uC131\uD55C\uB2E4 (--public-key \uBBF8\uC9C0\uC815 \uC2DC NHN \uC774 \uD0A4\uC30D \uC0DD\uC131 \u2014 private_key 1\uD68C\uC131)").argument("<name>", "\uD0A4\uD398\uC5B4 \uC774\uB984").option("--public-key <path|key>", "\uAE30\uC874 \uACF5\uAC1C\uD0A4 (\uD30C\uC77C \uACBD\uB85C \uB610\uB294 \uD0A4 \uBB38\uC790\uC5F4). \uC9C0\uC815 \uC2DC private_key \uBBF8\uBC18\uD658").option("-o, --output <keyfile>", "\uC0DD\uC131\uB41C private_key \uB97C \uD30C\uC77C(mode 0600)\uB85C \uC800\uC7A5").option("--region <region>", "region override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (name, _opts, cmd) => {
|
|
5927
6119
|
const opts = cmd.optsWithGlobals();
|
|
5928
6120
|
const publicKey = opts.publicKey !== void 0 ? resolvePublicKey(opts.publicKey) : void 0;
|
|
5929
6121
|
if (opts.output !== void 0 && publicKey !== void 0) {
|
|
@@ -5952,19 +6144,19 @@ var createKeypairCmd = new import_commander33.Command("create").description("\uD
|
|
|
5952
6144
|
if (opts.output !== void 0) {
|
|
5953
6145
|
try {
|
|
5954
6146
|
savePrivateKey(opts.output, result.private_key);
|
|
5955
|
-
process.stderr.write(
|
|
6147
|
+
process.stderr.write(import_chalk12.default.green(` private_key \uB97C ${opts.output} \uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4 (mode 0600).
|
|
5956
6148
|
`));
|
|
5957
6149
|
} catch (saveErr) {
|
|
5958
6150
|
const reason = saveErr instanceof Error ? saveErr.message : String(saveErr);
|
|
5959
6151
|
process.stderr.write(
|
|
5960
|
-
|
|
6152
|
+
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
6153
|
`)
|
|
5962
6154
|
);
|
|
5963
6155
|
process.stdout.write(result.private_key + "\n");
|
|
5964
6156
|
}
|
|
5965
6157
|
} else {
|
|
5966
6158
|
process.stderr.write(
|
|
5967
|
-
|
|
6159
|
+
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
6160
|
);
|
|
5969
6161
|
process.stdout.write(result.private_key + "\n");
|
|
5970
6162
|
}
|
|
@@ -5982,7 +6174,7 @@ var createKeypairCmd = new import_commander33.Command("create").description("\uD
|
|
|
5982
6174
|
ids: [meta.name]
|
|
5983
6175
|
});
|
|
5984
6176
|
});
|
|
5985
|
-
var deleteKeypairCmd = new
|
|
6177
|
+
var deleteKeypairCmd = new import_commander35.Command("delete").description("\uD0A4\uD398\uC5B4\uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<name>", "\uD0A4\uD398\uC5B4 \uC774\uB984").option("--region <region>", "region override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (name, _opts, cmd) => {
|
|
5986
6178
|
const opts = cmd.optsWithGlobals();
|
|
5987
6179
|
const { client } = await resolveInstanceClient(opts);
|
|
5988
6180
|
startSpinner("\uD0A4\uD398\uC5B4 \uC0AD\uC81C \uC911...");
|
|
@@ -5993,15 +6185,15 @@ var deleteKeypairCmd = new import_commander33.Command("delete").description("\uD
|
|
|
5993
6185
|
throw err;
|
|
5994
6186
|
}
|
|
5995
6187
|
stopSpinner(true);
|
|
5996
|
-
process.stderr.write(
|
|
6188
|
+
process.stderr.write(import_chalk12.default.green(`\u2713 \uD0A4\uD398\uC5B4 "${name}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5997
6189
|
`));
|
|
5998
6190
|
});
|
|
5999
|
-
var keypairCommand = new
|
|
6191
|
+
var keypairCommand = new import_commander35.Command("keypair").description("\uD0A4\uD398\uC5B4 \uB2E8\uAC74 \uAD00\uB9AC (get / create / delete)").addCommand(getKeypairCmd).addCommand(createKeypairCmd).addCommand(deleteKeypairCmd);
|
|
6000
6192
|
|
|
6001
6193
|
// src/commands/instance/volume.ts
|
|
6002
|
-
var
|
|
6003
|
-
var
|
|
6004
|
-
var attachCommand = new
|
|
6194
|
+
var import_commander36 = require("commander");
|
|
6195
|
+
var import_chalk13 = __toESM(require("chalk"));
|
|
6196
|
+
var attachCommand = new import_commander36.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
6197
|
const opts = cmd.optsWithGlobals();
|
|
6006
6198
|
const { client } = await resolveInstanceClient(opts);
|
|
6007
6199
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uC911...");
|
|
@@ -6014,7 +6206,7 @@ var attachCommand = new import_commander34.Command("attach").description("\uBCFC
|
|
|
6014
6206
|
}
|
|
6015
6207
|
stopSpinner(true);
|
|
6016
6208
|
process.stderr.write(
|
|
6017
|
-
|
|
6209
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uC644\uB8CC (volumeId: ${att.volumeId}, device: ${att.device})
|
|
6018
6210
|
`)
|
|
6019
6211
|
);
|
|
6020
6212
|
output(opts, {
|
|
@@ -6029,7 +6221,7 @@ var attachCommand = new import_commander34.Command("attach").description("\uBCFC
|
|
|
6029
6221
|
ids: [att.id]
|
|
6030
6222
|
});
|
|
6031
6223
|
});
|
|
6032
|
-
var detachCommand = new
|
|
6224
|
+
var detachCommand = new import_commander36.Command("detach").description("\uBCFC\uB968 \uC5F0\uACB0\uC744 \uD574\uC81C\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").argument("<volumeId>", "\uD574\uC81C\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, volumeId, _opts, cmd) => {
|
|
6033
6225
|
const opts = cmd.optsWithGlobals();
|
|
6034
6226
|
const { client } = await resolveInstanceClient(opts);
|
|
6035
6227
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -6041,19 +6233,19 @@ var detachCommand = new import_commander34.Command("detach").description("\uBCFC
|
|
|
6041
6233
|
}
|
|
6042
6234
|
stopSpinner(true);
|
|
6043
6235
|
process.stderr.write(
|
|
6044
|
-
|
|
6236
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC694\uCCAD \uC644\uB8CC (volumeId: ${volumeId})
|
|
6045
6237
|
`)
|
|
6046
6238
|
);
|
|
6047
6239
|
});
|
|
6048
|
-
var volumeCommand = new
|
|
6240
|
+
var volumeCommand = new import_commander36.Command("volume").description(
|
|
6049
6241
|
"\uC778\uC2A4\uD134\uC2A4 \uBCFC\uB968 \uC5F0\uACB0/\uD574\uC81C"
|
|
6050
6242
|
);
|
|
6051
6243
|
volumeCommand.addCommand(attachCommand);
|
|
6052
6244
|
volumeCommand.addCommand(detachCommand);
|
|
6053
6245
|
|
|
6054
6246
|
// src/commands/instance/volumes.ts
|
|
6055
|
-
var
|
|
6056
|
-
var volumesCommand = new
|
|
6247
|
+
var import_commander37 = require("commander");
|
|
6248
|
+
var volumesCommand = new import_commander37.Command("volumes").description("\uC778\uC2A4\uD134\uC2A4\uC5D0 \uC5F0\uACB0\uB41C \uBCFC\uB968 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").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) => {
|
|
6057
6249
|
const opts = cmd.optsWithGlobals();
|
|
6058
6250
|
const { client } = await resolveInstanceClient(opts);
|
|
6059
6251
|
startSpinner("\uBCFC\uB968 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6074,7 +6266,7 @@ var volumesCommand = new import_commander35.Command("volumes").description("\uC7
|
|
|
6074
6266
|
});
|
|
6075
6267
|
|
|
6076
6268
|
// src/commands/ncr/list.ts
|
|
6077
|
-
var
|
|
6269
|
+
var import_commander38 = require("commander");
|
|
6078
6270
|
|
|
6079
6271
|
// src/services/ncr/harbor-client.ts
|
|
6080
6272
|
var import_ky12 = __toESM(require("ky"));
|
|
@@ -6166,27 +6358,16 @@ async function createNcrClient(opts) {
|
|
|
6166
6358
|
const region = opts.region ?? "kr1";
|
|
6167
6359
|
return { client: new NcrClient(uak.id, uak.secret, region), profileName };
|
|
6168
6360
|
}
|
|
6169
|
-
async function resolveAppKey(profileName
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
if (!(err instanceof NhnCloudCliError) || err.exitCode !== EXIT_CONFIG_ERROR) {
|
|
6176
|
-
throw err;
|
|
6177
|
-
}
|
|
6178
|
-
}
|
|
6179
|
-
if (!cred?.appkey) {
|
|
6180
|
-
throw new NhnCloudCliError(
|
|
6181
|
-
"NCR appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. --app-key \uC635\uC158\uC73C\uB85C \uC9C0\uC815\uD558\uAC70\uB098\nnhncloud configure --ncr-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694.",
|
|
6182
|
-
EXIT_CONFIG_ERROR
|
|
6183
|
-
);
|
|
6184
|
-
}
|
|
6185
|
-
return cred.appkey;
|
|
6361
|
+
async function resolveAppKey(profileName) {
|
|
6362
|
+
return resolveServiceAppKey(
|
|
6363
|
+
"ncr",
|
|
6364
|
+
profileName,
|
|
6365
|
+
"NCR appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.\nnhncloud configure --ncr-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694."
|
|
6366
|
+
);
|
|
6186
6367
|
}
|
|
6187
6368
|
async function createHarborClient(opts, registryArg) {
|
|
6188
6369
|
const { client: ncrClient, profileName } = await createNcrClient(opts);
|
|
6189
|
-
const appKey = await resolveAppKey(profileName
|
|
6370
|
+
const appKey = await resolveAppKey(profileName);
|
|
6190
6371
|
const uak = await getUserAccessKey(profileName);
|
|
6191
6372
|
const reg = await ncrClient.getRegistry(appKey, registryArg);
|
|
6192
6373
|
const host = parseHarborHost(reg.uri);
|
|
@@ -6212,10 +6393,10 @@ function parseHarborHost(uri) {
|
|
|
6212
6393
|
}
|
|
6213
6394
|
|
|
6214
6395
|
// src/commands/ncr/list.ts
|
|
6215
|
-
var listCommand5 = new
|
|
6396
|
+
var listCommand5 = new import_commander38.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
6397
|
const opts = cmd.optsWithGlobals();
|
|
6217
6398
|
const { client, profileName } = await createNcrClient(opts);
|
|
6218
|
-
const appKey = await resolveAppKey(profileName
|
|
6399
|
+
const appKey = await resolveAppKey(profileName);
|
|
6219
6400
|
startSpinner("\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
6220
6401
|
let registries;
|
|
6221
6402
|
try {
|
|
@@ -6238,8 +6419,8 @@ var listCommand5 = new import_commander36.Command("list").description("NCR \uB80
|
|
|
6238
6419
|
});
|
|
6239
6420
|
|
|
6240
6421
|
// src/commands/ncr/get.ts
|
|
6241
|
-
var
|
|
6242
|
-
var getCommand3 = new
|
|
6422
|
+
var import_commander39 = require("commander");
|
|
6423
|
+
var getCommand3 = new import_commander39.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
6424
|
const opts = cmd.optsWithGlobals();
|
|
6244
6425
|
if (!registry.trim()) {
|
|
6245
6426
|
throw new NhnCloudCliError(
|
|
@@ -6248,7 +6429,7 @@ var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77
|
|
|
6248
6429
|
);
|
|
6249
6430
|
}
|
|
6250
6431
|
const { client, profileName } = await createNcrClient(opts);
|
|
6251
|
-
const appKey = await resolveAppKey(profileName
|
|
6432
|
+
const appKey = await resolveAppKey(profileName);
|
|
6252
6433
|
startSpinner(`\uB808\uC9C0\uC2A4\uD2B8\uB9AC "${registry}" \uC870\uD68C \uC911...`);
|
|
6253
6434
|
let reg;
|
|
6254
6435
|
try {
|
|
@@ -6267,8 +6448,8 @@ var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77
|
|
|
6267
6448
|
});
|
|
6268
6449
|
|
|
6269
6450
|
// src/commands/ncr/images.ts
|
|
6270
|
-
var
|
|
6271
|
-
var imagesCommand2 = new
|
|
6451
|
+
var import_commander40 = require("commander");
|
|
6452
|
+
var imagesCommand2 = new import_commander40.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
6453
|
const opts = cmd.optsWithGlobals();
|
|
6273
6454
|
if (!registry.trim()) {
|
|
6274
6455
|
throw new NhnCloudCliError(
|
|
@@ -6302,8 +6483,8 @@ var imagesCommand2 = new import_commander38.Command("images").description("\uB80
|
|
|
6302
6483
|
});
|
|
6303
6484
|
|
|
6304
6485
|
// src/commands/ncr/tags.ts
|
|
6305
|
-
var
|
|
6306
|
-
var tagsCommand = new
|
|
6486
|
+
var import_commander41 = require("commander");
|
|
6487
|
+
var tagsCommand = new import_commander41.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
6488
|
const opts = cmd.optsWithGlobals();
|
|
6308
6489
|
if (!registry.trim()) {
|
|
6309
6490
|
throw new NhnCloudCliError(
|
|
@@ -6344,7 +6525,7 @@ var tagsCommand = new import_commander39.Command("tags").description("\uD2B9\uC8
|
|
|
6344
6525
|
});
|
|
6345
6526
|
|
|
6346
6527
|
// src/commands/commands.ts
|
|
6347
|
-
var
|
|
6528
|
+
var import_commander42 = require("commander");
|
|
6348
6529
|
function commandPath(command) {
|
|
6349
6530
|
const names = [];
|
|
6350
6531
|
let current2 = command;
|
|
@@ -6382,7 +6563,7 @@ function collectCommandCatalog(program2) {
|
|
|
6382
6563
|
return { commands };
|
|
6383
6564
|
}
|
|
6384
6565
|
function createCommandsCommand(program2) {
|
|
6385
|
-
return new
|
|
6566
|
+
return new import_commander42.Command("commands").description("\uBA85\uB839 \uACBD\uB85C\uC640 \uC635\uC158 catalog\uB97C \uCD9C\uB825\uD55C\uB2E4").action((_opts, cmd) => {
|
|
6386
6567
|
const opts = cmd.optsWithGlobals();
|
|
6387
6568
|
const catalog = collectCommandCatalog(program2);
|
|
6388
6569
|
output(opts, {
|
|
@@ -6399,7 +6580,7 @@ function createCommandsCommand(program2) {
|
|
|
6399
6580
|
}
|
|
6400
6581
|
|
|
6401
6582
|
// src/commands/nks/supports.ts
|
|
6402
|
-
var
|
|
6583
|
+
var import_commander43 = require("commander");
|
|
6403
6584
|
|
|
6404
6585
|
// src/commands/nks/helpers.ts
|
|
6405
6586
|
var import_promises6 = require("fs/promises");
|
|
@@ -6972,7 +7153,7 @@ function parseNonNegativeInteger(value, optionName) {
|
|
|
6972
7153
|
}
|
|
6973
7154
|
|
|
6974
7155
|
// src/commands/nks/supports.ts
|
|
6975
|
-
var supportsCommand = new
|
|
7156
|
+
var supportsCommand = new import_commander43.Command("supports").description("NKS \uC9C0\uC6D0 Kubernetes \uBC84\uC804\uACFC event type \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) => {
|
|
6976
7157
|
const opts = cmd.optsWithGlobals();
|
|
6977
7158
|
const { client } = await resolveNksClient(opts);
|
|
6978
7159
|
startSpinner("NKS \uC9C0\uC6D0 \uC815\uBCF4 \uC870\uD68C \uC911...");
|
|
@@ -6997,9 +7178,9 @@ var supportsCommand = new import_commander41.Command("supports").description("NK
|
|
|
6997
7178
|
|
|
6998
7179
|
// src/commands/nks/cluster.ts
|
|
6999
7180
|
var import_promises7 = require("fs/promises");
|
|
7000
|
-
var
|
|
7001
|
-
var
|
|
7002
|
-
var listCommand6 = new
|
|
7181
|
+
var import_commander44 = require("commander");
|
|
7182
|
+
var import_chalk14 = __toESM(require("chalk"));
|
|
7183
|
+
var listCommand6 = new import_commander44.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
7184
|
const opts = cmd.optsWithGlobals();
|
|
7004
7185
|
const { client } = await resolveNksClient(opts);
|
|
7005
7186
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7062,7 +7243,7 @@ function clusterIpAclRow(ipAcl) {
|
|
|
7062
7243
|
];
|
|
7063
7244
|
}
|
|
7064
7245
|
function uuidOutput(opts, result, label) {
|
|
7065
|
-
process.stderr.write(
|
|
7246
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
7066
7247
|
`));
|
|
7067
7248
|
output(opts, {
|
|
7068
7249
|
headers: ["field", "value"],
|
|
@@ -7083,7 +7264,7 @@ async function confirmDangerousAction(message, yes) {
|
|
|
7083
7264
|
const { confirm } = await import("@inquirer/prompts");
|
|
7084
7265
|
const ok = await confirm({ message, default: false });
|
|
7085
7266
|
if (!ok) {
|
|
7086
|
-
process.stderr.write(
|
|
7267
|
+
process.stderr.write(import_chalk14.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7087
7268
|
}
|
|
7088
7269
|
return ok;
|
|
7089
7270
|
}
|
|
@@ -7105,7 +7286,7 @@ async function writeKubeconfigFile(path5, contents, force) {
|
|
|
7105
7286
|
throw err;
|
|
7106
7287
|
}
|
|
7107
7288
|
}
|
|
7108
|
-
var createCommand4 = new
|
|
7289
|
+
var createCommand4 = new import_commander44.Command("create").description("NKS \uD074\uB7EC\uC2A4\uD130\uB97C \uC0DD\uC131\uD55C\uB2E4").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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) => {
|
|
7109
7290
|
const opts = cmd.optsWithGlobals();
|
|
7110
7291
|
const payload = await readJsonFile(opts.file);
|
|
7111
7292
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7120,7 +7301,7 @@ var createCommand4 = new import_commander42.Command("create").description("NKS \
|
|
|
7120
7301
|
stopSpinner(true);
|
|
7121
7302
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC0DD\uC131");
|
|
7122
7303
|
});
|
|
7123
|
-
var deleteCommand3 = new
|
|
7304
|
+
var deleteCommand3 = new import_commander44.Command("delete").description("NKS \uD074\uB7EC\uC2A4\uD130\uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").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 (cluster, _opts, cmd) => {
|
|
7124
7305
|
const opts = cmd.optsWithGlobals();
|
|
7125
7306
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7126
7307
|
if (!ok) return;
|
|
@@ -7133,15 +7314,15 @@ var deleteCommand3 = new import_commander42.Command("delete").description("NKS \
|
|
|
7133
7314
|
throw err;
|
|
7134
7315
|
}
|
|
7135
7316
|
stopSpinner(true);
|
|
7136
|
-
process.stderr.write(
|
|
7317
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7137
7318
|
`));
|
|
7138
7319
|
});
|
|
7139
|
-
var resizeCommand2 = new
|
|
7320
|
+
var resizeCommand2 = new import_commander44.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) => {
|
|
7140
7321
|
const opts = cmd.optsWithGlobals();
|
|
7141
7322
|
const nodeCount = parsePositiveInteger(opts.nodeCount, "--node-count");
|
|
7142
7323
|
const nodesToRemove = opts.nodesToRemove?.split(",").map((node) => node.trim()).filter(Boolean);
|
|
7143
7324
|
if (!nodesToRemove || nodesToRemove.length === 0) {
|
|
7144
|
-
process.stderr.write(
|
|
7325
|
+
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
7326
|
}
|
|
7146
7327
|
const { client } = await resolveNksClient(opts);
|
|
7147
7328
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 resize \uC694\uCCAD \uC911...");
|
|
@@ -7160,7 +7341,7 @@ var resizeCommand2 = new import_commander42.Command("resize").description("NKS \
|
|
|
7160
7341
|
stopSpinner(true);
|
|
7161
7342
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 resize");
|
|
7162
7343
|
});
|
|
7163
|
-
var setIpAclCommand = new
|
|
7344
|
+
var setIpAclCommand = new import_commander44.Command("set-ipacl").description("NKS \uD074\uB7EC\uC2A4\uD130 API endpoint IP ACL \uC744 \uC124\uC815\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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) => {
|
|
7164
7345
|
const opts = cmd.optsWithGlobals();
|
|
7165
7346
|
const payload = await readJsonFile(opts.file);
|
|
7166
7347
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7175,7 +7356,7 @@ var setIpAclCommand = new import_commander42.Command("set-ipacl").description("N
|
|
|
7175
7356
|
stopSpinner(true);
|
|
7176
7357
|
uuidOutput(opts, result, "IP ACL \uC124\uC815");
|
|
7177
7358
|
});
|
|
7178
|
-
var renewCertificateCommand = new
|
|
7359
|
+
var renewCertificateCommand = new import_commander44.Command("renew-certificate").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC778\uC99D\uC11C\uB97C \uAC31\uC2E0\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--term-of-validity <1-5>", "\uC778\uC99D\uC11C \uC720\uD6A8 \uAE30\uAC04(\uB144)").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) => {
|
|
7179
7360
|
const opts = cmd.optsWithGlobals();
|
|
7180
7361
|
const term = parsePositiveInteger(opts.termOfValidity, "--term-of-validity");
|
|
7181
7362
|
if (term < 1 || term > 5) {
|
|
@@ -7193,7 +7374,7 @@ var renewCertificateCommand = new import_commander42.Command("renew-certificate"
|
|
|
7193
7374
|
stopSpinner(true);
|
|
7194
7375
|
uuidOutput(opts, result, "\uC778\uC99D\uC11C \uAC31\uC2E0");
|
|
7195
7376
|
});
|
|
7196
|
-
var updateSgwCommand = new
|
|
7377
|
+
var updateSgwCommand = new import_commander44.Command("update-sgw").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774\uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--ncr-sgw <uuid>", "NCR service gateway UUID").requiredOption("--obs-sgw <uuid>", "Object Storage service gateway UUID").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) => {
|
|
7197
7378
|
const opts = cmd.optsWithGlobals();
|
|
7198
7379
|
const { client } = await resolveNksClient(opts);
|
|
7199
7380
|
startSpinner("NKS \uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7207,7 +7388,7 @@ var updateSgwCommand = new import_commander42.Command("update-sgw").description(
|
|
|
7207
7388
|
stopSpinner(true);
|
|
7208
7389
|
uuidOutput(opts, result, "\uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD");
|
|
7209
7390
|
});
|
|
7210
|
-
var setControlPlaneLogCommand = new
|
|
7391
|
+
var setControlPlaneLogCommand = new import_commander44.Command("set-control-plane-log").description("NKS \uD074\uB7EC\uC2A4\uD130 control plane log \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "control_plane_log \uAC1D\uCCB4 JSON \uD30C\uC77C").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) => {
|
|
7211
7392
|
const opts = cmd.optsWithGlobals();
|
|
7212
7393
|
const controlPlaneLog = await readJsonFile(opts.file);
|
|
7213
7394
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7222,7 +7403,7 @@ var setControlPlaneLogCommand = new import_commander42.Command("set-control-plan
|
|
|
7222
7403
|
stopSpinner(true);
|
|
7223
7404
|
uuidOutput(opts, result, "control plane log \uC124\uC815");
|
|
7224
7405
|
});
|
|
7225
|
-
var getCommand4 = new
|
|
7406
|
+
var getCommand4 = new import_commander44.Command("get").description("NKS \uD074\uB7EC\uC2A4\uD130\uB97C \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) => {
|
|
7226
7407
|
const opts = cmd.optsWithGlobals();
|
|
7227
7408
|
const { client } = await resolveNksClient(opts);
|
|
7228
7409
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC870\uD68C \uC911...");
|
|
@@ -7241,7 +7422,7 @@ var getCommand4 = new import_commander42.Command("get").description("NKS \uD074\
|
|
|
7241
7422
|
ids: [resourceId(result)]
|
|
7242
7423
|
});
|
|
7243
7424
|
});
|
|
7244
|
-
var eventsCommand = new
|
|
7425
|
+
var eventsCommand = new import_commander44.Command("events").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825\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) => {
|
|
7245
7426
|
const opts = cmd.optsWithGlobals();
|
|
7246
7427
|
const { client } = await resolveNksClient(opts);
|
|
7247
7428
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uC870\uD68C \uC911...");
|
|
@@ -7262,7 +7443,7 @@ var eventsCommand = new import_commander42.Command("events").description("NKS \u
|
|
|
7262
7443
|
ids: events.map((event) => event.uuid)
|
|
7263
7444
|
});
|
|
7264
7445
|
});
|
|
7265
|
-
var eventCommand = new
|
|
7446
|
+
var eventCommand = new import_commander44.Command("event").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<event>", "\uC791\uC5C5 \uC774\uB825 UUID (\uC815\uC218 id \uAC00 \uC544\uB2C8\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 (cluster, event, _opts, cmd) => {
|
|
7266
7447
|
const opts = cmd.optsWithGlobals();
|
|
7267
7448
|
if (!isUuid(event)) {
|
|
7268
7449
|
throw new NhnCloudCliError(
|
|
@@ -7291,7 +7472,7 @@ var eventCommand = new import_commander42.Command("event").description("NKS \uD0
|
|
|
7291
7472
|
ids: [result.uuid]
|
|
7292
7473
|
});
|
|
7293
7474
|
});
|
|
7294
|
-
var kubeconfigCommand = new
|
|
7475
|
+
var kubeconfigCommand = new import_commander44.Command("kubeconfig").description("NKS \uD074\uB7EC\uC2A4\uD130 kubeconfig \uB97C \uCD9C\uB825\uD558\uAC70\uB098 \uC800\uC7A5\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").option("--output <file>", "kubeconfig \uC800\uC7A5 \uACBD\uB85C").option("--force", "\uAE30\uC874 \uD30C\uC77C \uB36E\uC5B4\uC4F0\uAE30").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) => {
|
|
7295
7476
|
const opts = cmd.optsWithGlobals();
|
|
7296
7477
|
const { client } = await resolveNksClient(opts);
|
|
7297
7478
|
startSpinner("NKS kubeconfig \uC870\uD68C \uC911...");
|
|
@@ -7305,13 +7486,13 @@ var kubeconfigCommand = new import_commander42.Command("kubeconfig").description
|
|
|
7305
7486
|
stopSpinner(true);
|
|
7306
7487
|
if (opts.output) {
|
|
7307
7488
|
await writeKubeconfigFile(opts.output, kubeconfig, opts.force);
|
|
7308
|
-
process.stderr.write(
|
|
7489
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 kubeconfig \uB97C \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4: ${opts.output}
|
|
7309
7490
|
`));
|
|
7310
7491
|
return;
|
|
7311
7492
|
}
|
|
7312
7493
|
process.stdout.write(kubeconfig.endsWith("\n") ? kubeconfig : kubeconfig + "\n");
|
|
7313
7494
|
});
|
|
7314
|
-
var ipAclCommand = new
|
|
7495
|
+
var ipAclCommand = new import_commander44.Command("ipacl").description("NKS \uD074\uB7EC\uC2A4\uD130 API endpoint IP ACL \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) => {
|
|
7315
7496
|
const opts = cmd.optsWithGlobals();
|
|
7316
7497
|
const { client } = await resolveNksClient(opts);
|
|
7317
7498
|
startSpinner("NKS IP ACL \uC870\uD68C \uC911...");
|
|
@@ -7330,7 +7511,7 @@ var ipAclCommand = new import_commander42.Command("ipacl").description("NKS \uD0
|
|
|
7330
7511
|
ids: [result.cluster_uuid]
|
|
7331
7512
|
});
|
|
7332
7513
|
});
|
|
7333
|
-
var clusterAddonListCommand = new
|
|
7514
|
+
var clusterAddonListCommand = new import_commander44.Command("list").description("NKS \uD074\uB7EC\uC2A4\uD130\uC5D0 \uC124\uCE58\uB41C \uC560\uB4DC\uC628 \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) => {
|
|
7334
7515
|
const opts = cmd.optsWithGlobals();
|
|
7335
7516
|
const { client } = await resolveNksClient(opts);
|
|
7336
7517
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7349,7 +7530,7 @@ var clusterAddonListCommand = new import_commander42.Command("list").description
|
|
|
7349
7530
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
7350
7531
|
});
|
|
7351
7532
|
});
|
|
7352
|
-
var clusterAddonGetCommand = new
|
|
7533
|
+
var clusterAddonGetCommand = new import_commander44.Command("get").description("NKS \uD074\uB7EC\uC2A4\uD130\uC5D0 \uC124\uCE58\uB41C \uC560\uB4DC\uC628\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<addon>", "\uC560\uB4DC\uC628 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, addon, _opts, cmd) => {
|
|
7353
7534
|
const opts = cmd.optsWithGlobals();
|
|
7354
7535
|
const { client } = await resolveNksClient(opts);
|
|
7355
7536
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -7377,7 +7558,7 @@ function parseResolveConflicts(value) {
|
|
|
7377
7558
|
EXIT_PARAM_ERROR
|
|
7378
7559
|
);
|
|
7379
7560
|
}
|
|
7380
|
-
var clusterAddonInstallCommand = new
|
|
7561
|
+
var clusterAddonInstallCommand = new import_commander44.Command("install").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628\uC744 \uC124\uCE58\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--name <name>", "\uC560\uB4DC\uC628 \uC774\uB984").requiredOption("--addon-version <version>", "\uC560\uB4DC\uC628 \uBC84\uC804").requiredOption("--resolve-conflicts <none|overwrite|preserve>", "\uCDA9\uB3CC \uD574\uACB0 \uC815\uCC45").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) => {
|
|
7381
7562
|
const opts = cmd.optsWithGlobals();
|
|
7382
7563
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7383
7564
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7396,7 +7577,7 @@ var clusterAddonInstallCommand = new import_commander42.Command("install").descr
|
|
|
7396
7577
|
stopSpinner(true);
|
|
7397
7578
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC124\uCE58");
|
|
7398
7579
|
});
|
|
7399
|
-
var clusterAddonUpdateCommand = new
|
|
7580
|
+
var clusterAddonUpdateCommand = new import_commander44.Command("update").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628\uC744 \uC5C5\uB370\uC774\uD2B8\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<addon>", "\uC560\uB4DC\uC628 UUID \uB610\uB294 \uC774\uB984").requiredOption("--addon-version <version>", "\uC560\uB4DC\uC628 \uBC84\uC804").requiredOption("--resolve-conflicts <none|overwrite|preserve>", "\uCDA9\uB3CC \uD574\uACB0 \uC815\uCC45").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, addon, _opts, cmd) => {
|
|
7400
7581
|
const opts = cmd.optsWithGlobals();
|
|
7401
7582
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7402
7583
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7414,7 +7595,7 @@ var clusterAddonUpdateCommand = new import_commander42.Command("update").descrip
|
|
|
7414
7595
|
stopSpinner(true);
|
|
7415
7596
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC5C5\uB370\uC774\uD2B8");
|
|
7416
7597
|
});
|
|
7417
|
-
var clusterAddonRemoveCommand = new
|
|
7598
|
+
var clusterAddonRemoveCommand = new import_commander44.Command("remove").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628\uC744 \uC81C\uAC70\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<addon>", "\uC560\uB4DC\uC628 UUID \uB610\uB294 \uC774\uB984").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 (cluster, addon, _opts, cmd) => {
|
|
7418
7599
|
const opts = cmd.optsWithGlobals();
|
|
7419
7600
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 "${addon}" \uC744 \uC81C\uAC70\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7420
7601
|
if (!ok) return;
|
|
@@ -7430,12 +7611,12 @@ var clusterAddonRemoveCommand = new import_commander42.Command("remove").descrip
|
|
|
7430
7611
|
stopSpinner(true);
|
|
7431
7612
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC81C\uAC70");
|
|
7432
7613
|
});
|
|
7433
|
-
var clusterAddonCommand = new
|
|
7434
|
-
var clusterCommand = new
|
|
7614
|
+
var clusterAddonCommand = new import_commander44.Command("addon").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uAD00\uB828 \uBA85\uB839").addCommand(clusterAddonListCommand).addCommand(clusterAddonGetCommand).addCommand(clusterAddonInstallCommand).addCommand(clusterAddonUpdateCommand).addCommand(clusterAddonRemoveCommand);
|
|
7615
|
+
var clusterCommand = new import_commander44.Command("cluster").description("NKS \uD074\uB7EC\uC2A4\uD130 \uAD00\uB828 \uBA85\uB839").addCommand(listCommand6).addCommand(getCommand4).addCommand(createCommand4).addCommand(deleteCommand3).addCommand(resizeCommand2).addCommand(eventsCommand).addCommand(eventCommand).addCommand(kubeconfigCommand).addCommand(ipAclCommand).addCommand(setIpAclCommand).addCommand(renewCertificateCommand).addCommand(updateSgwCommand).addCommand(setControlPlaneLogCommand).addCommand(clusterAddonCommand);
|
|
7435
7616
|
|
|
7436
7617
|
// src/commands/nks/nodegroup.ts
|
|
7437
|
-
var
|
|
7438
|
-
var
|
|
7618
|
+
var import_commander45 = require("commander");
|
|
7619
|
+
var import_chalk15 = __toESM(require("chalk"));
|
|
7439
7620
|
function nodeGroupRow(nodegroup) {
|
|
7440
7621
|
return [
|
|
7441
7622
|
nodegroup.uuid,
|
|
@@ -7452,7 +7633,7 @@ function rawObjectRows(resource) {
|
|
|
7452
7633
|
]);
|
|
7453
7634
|
}
|
|
7454
7635
|
function uuidOutput2(opts, result, label) {
|
|
7455
|
-
process.stderr.write(
|
|
7636
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
7456
7637
|
`));
|
|
7457
7638
|
output(opts, {
|
|
7458
7639
|
headers: ["field", "value"],
|
|
@@ -7485,10 +7666,10 @@ async function confirmDangerousAction2(message, yes) {
|
|
|
7485
7666
|
if (!isTTY || yes) return true;
|
|
7486
7667
|
const { confirm } = await import("@inquirer/prompts");
|
|
7487
7668
|
const ok = await confirm({ message, default: false });
|
|
7488
|
-
if (!ok) process.stderr.write(
|
|
7669
|
+
if (!ok) process.stderr.write(import_chalk15.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7489
7670
|
return ok;
|
|
7490
7671
|
}
|
|
7491
|
-
var listCommand7 = new
|
|
7672
|
+
var listCommand7 = new import_commander45.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) => {
|
|
7492
7673
|
const opts = cmd.optsWithGlobals();
|
|
7493
7674
|
const { client } = await resolveNksClient(opts);
|
|
7494
7675
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7507,7 +7688,7 @@ var listCommand7 = new import_commander43.Command("list").description("NKS \uB17
|
|
|
7507
7688
|
ids: nodegroups.map((nodegroup) => nodegroup.uuid)
|
|
7508
7689
|
});
|
|
7509
7690
|
});
|
|
7510
|
-
var getCommand5 = new
|
|
7691
|
+
var getCommand5 = new import_commander45.Command("get").description("NKS \uB178\uB4DC \uADF8\uB8F9\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 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, nodegroup, _opts, cmd) => {
|
|
7511
7692
|
const opts = cmd.optsWithGlobals();
|
|
7512
7693
|
const { client } = await resolveNksClient(opts);
|
|
7513
7694
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uC870\uD68C \uC911...");
|
|
@@ -7526,7 +7707,7 @@ var getCommand5 = new import_commander43.Command("get").description("NKS \uB178\
|
|
|
7526
7707
|
ids: [result.uuid]
|
|
7527
7708
|
});
|
|
7528
7709
|
});
|
|
7529
|
-
var createCommand5 = new
|
|
7710
|
+
var createCommand5 = new import_commander45.Command("create").description("NKS \uB178\uB4DC \uADF8\uB8F9\uC744 \uC0DD\uC131\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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) => {
|
|
7530
7711
|
const opts = cmd.optsWithGlobals();
|
|
7531
7712
|
const payload = await readJsonFile(opts.file);
|
|
7532
7713
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7541,7 +7722,7 @@ var createCommand5 = new import_commander43.Command("create").description("NKS \
|
|
|
7541
7722
|
stopSpinner(true);
|
|
7542
7723
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 \uC0DD\uC131");
|
|
7543
7724
|
});
|
|
7544
|
-
var deleteCommand4 = new
|
|
7725
|
+
var deleteCommand4 = new import_commander45.Command("delete").description("NKS \uB178\uB4DC \uADF8\uB8F9\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").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 (cluster, nodegroup, _opts, cmd) => {
|
|
7545
7726
|
const opts = cmd.optsWithGlobals();
|
|
7546
7727
|
const ok = await confirmDangerousAction2(`NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7547
7728
|
if (!ok) return;
|
|
@@ -7554,11 +7735,11 @@ var deleteCommand4 = new import_commander43.Command("delete").description("NKS \
|
|
|
7554
7735
|
throw err;
|
|
7555
7736
|
}
|
|
7556
7737
|
stopSpinner(true);
|
|
7557
|
-
process.stderr.write(
|
|
7738
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7558
7739
|
`));
|
|
7559
7740
|
});
|
|
7560
7741
|
function nodeActionCommand(name) {
|
|
7561
|
-
return new
|
|
7742
|
+
return new import_commander45.Command(name).description(`NKS \uB178\uB4DC \uADF8\uB8F9 \uB178\uB4DC\uB97C ${name === "stop-node" ? "\uC911\uC9C0" : "\uC2DC\uC791"}\uD55C\uB2E4`).argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--nodes <csv>", "\uB300\uC0C1 \uB178\uB4DC 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, nodegroup, _opts, cmd) => {
|
|
7562
7743
|
const opts = cmd.optsWithGlobals();
|
|
7563
7744
|
const nodes = parseCsv(opts.nodes, "--nodes");
|
|
7564
7745
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7574,7 +7755,7 @@ function nodeActionCommand(name) {
|
|
|
7574
7755
|
uuidOutput2(opts, result, `\uB178\uB4DC ${name === "stop-node" ? "\uC911\uC9C0" : "\uC2DC\uC791"}`);
|
|
7575
7756
|
});
|
|
7576
7757
|
}
|
|
7577
|
-
var autoscaleCommand = new
|
|
7758
|
+
var autoscaleCommand = new import_commander45.Command("autoscale").description("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC124\uC815\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 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, nodegroup, _opts, cmd) => {
|
|
7578
7759
|
const opts = cmd.optsWithGlobals();
|
|
7579
7760
|
const { client } = await resolveNksClient(opts);
|
|
7580
7761
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC870\uD68C \uC911...");
|
|
@@ -7593,7 +7774,7 @@ var autoscaleCommand = new import_commander43.Command("autoscale").description("
|
|
|
7593
7774
|
ids: []
|
|
7594
7775
|
});
|
|
7595
7776
|
});
|
|
7596
|
-
var setAutoscaleCommand = new
|
|
7777
|
+
var setAutoscaleCommand = new import_commander45.Command("set-autoscale").description("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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, nodegroup, _opts, cmd) => {
|
|
7597
7778
|
const opts = cmd.optsWithGlobals();
|
|
7598
7779
|
const payload = await readJsonFile(opts.file);
|
|
7599
7780
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7608,7 +7789,7 @@ var setAutoscaleCommand = new import_commander43.Command("set-autoscale").descri
|
|
|
7608
7789
|
stopSpinner(true);
|
|
7609
7790
|
uuidOutput2(opts, result, "autoscale \uBCC0\uACBD");
|
|
7610
7791
|
});
|
|
7611
|
-
var setMetricAutoscaleCommand = new
|
|
7792
|
+
var setMetricAutoscaleCommand = new import_commander45.Command("set-metric-autoscale").description("NKS \uB178\uB4DC \uADF8\uB8F9 metric autoscale \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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, nodegroup, _opts, cmd) => {
|
|
7612
7793
|
const opts = cmd.optsWithGlobals();
|
|
7613
7794
|
const payload = await readJsonFile(opts.file);
|
|
7614
7795
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7623,7 +7804,7 @@ var setMetricAutoscaleCommand = new import_commander43.Command("set-metric-autos
|
|
|
7623
7804
|
stopSpinner(true);
|
|
7624
7805
|
uuidOutput2(opts, result, "metric autoscale \uBCC0\uACBD");
|
|
7625
7806
|
});
|
|
7626
|
-
var upgradeCommand = new
|
|
7807
|
+
var upgradeCommand = new import_commander45.Command("upgrade").description("NKS \uB178\uB4DC \uADF8\uB8F9 Kubernetes version \uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD55C\uB2E4 (default-master \uB85C control plane \uC5C5\uADF8\uB808\uC774\uB4DC)").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984. control plane \uC740 default-master \uB85C \uC9C0\uC815\uD55C\uB2E4").requiredOption("--kube-version <v>", "\uB300\uC0C1 Kubernetes version").option("--num-buffer-nodes <n>", "\uCD95\uCD9C\uB41C \uD30C\uB4DC\uB97C \uBC1B\uC744 \uC5EC\uC720 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uC791\uC5C5 \uD6C4 \uC790\uB3D9 \uC0AD\uC81C, \uC778\uC2A4\uD134\uC2A4 \uC694\uAE08 \uBC1C\uC0DD)").option("--num-max-unavailable-nodes <n>", "\uD55C \uBC88\uC5D0 \uC11C\uBE44\uC2A4 \uBD88\uAC00 \uC0C1\uD0DC\uB85C \uB458 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uD06C\uBA74 \uBE60\uB974\uACE0 \uAC00\uC6A9\uC131 \uB0AE\uC74C)").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, nodegroup, _opts, cmd) => {
|
|
7627
7808
|
const opts = cmd.optsWithGlobals();
|
|
7628
7809
|
const { client } = await resolveNksClient(opts);
|
|
7629
7810
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 upgrade \uC694\uCCAD \uC911...");
|
|
@@ -7641,7 +7822,7 @@ var upgradeCommand = new import_commander43.Command("upgrade").description("NKS
|
|
|
7641
7822
|
stopSpinner(true);
|
|
7642
7823
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 upgrade");
|
|
7643
7824
|
});
|
|
7644
|
-
var setUserscriptCommand = new
|
|
7825
|
+
var setUserscriptCommand = new import_commander45.Command("set-userscript").description("NKS \uB178\uB4DC \uADF8\uB8F9 user script \uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <script>", "script \uD30C\uC77C").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, nodegroup, _opts, cmd) => {
|
|
7645
7826
|
const opts = cmd.optsWithGlobals();
|
|
7646
7827
|
const contents = await readTextFile(opts.file);
|
|
7647
7828
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7656,7 +7837,7 @@ var setUserscriptCommand = new import_commander43.Command("set-userscript").desc
|
|
|
7656
7837
|
stopSpinner(true);
|
|
7657
7838
|
uuidOutput2(opts, result, "user script \uBCC0\uACBD");
|
|
7658
7839
|
});
|
|
7659
|
-
var updateFlavorCommand = new
|
|
7840
|
+
var updateFlavorCommand = new import_commander45.Command("update-flavor").description("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--flavor <uuid>", "\uBCC0\uACBD\uD560 flavor UUID").option("--num-buffer-nodes <n>", "\uCD95\uCD9C\uB41C \uD30C\uB4DC\uB97C \uBC1B\uC744 \uC5EC\uC720 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uC791\uC5C5 \uD6C4 \uC790\uB3D9 \uC0AD\uC81C, \uC778\uC2A4\uD134\uC2A4 \uC694\uAE08 \uBC1C\uC0DD)").option("--num-max-unavailable-nodes <n>", "\uD55C \uBC88\uC5D0 \uC11C\uBE44\uC2A4 \uBD88\uAC00 \uC0C1\uD0DC\uB85C \uB458 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uD06C\uBA74 \uBE60\uB974\uACE0 \uAC00\uC6A9\uC131 \uB0AE\uC74C)").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, nodegroup, _opts, cmd) => {
|
|
7660
7841
|
const opts = cmd.optsWithGlobals();
|
|
7661
7842
|
const { client } = await resolveNksClient(opts);
|
|
7662
7843
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7675,7 +7856,7 @@ var updateFlavorCommand = new import_commander43.Command("update-flavor").descri
|
|
|
7675
7856
|
uuidOutput2(opts, result, "flavor \uBCC0\uACBD");
|
|
7676
7857
|
});
|
|
7677
7858
|
function patchPayloadCommand(name) {
|
|
7678
|
-
return new
|
|
7859
|
+
return new import_commander45.Command(name).description(`NKS \uB178\uB4DC \uADF8\uB8F9 ${name === "set-fip-auto-bind" ? "Floating IP \uC790\uB3D9 \uC5F0\uACB0" : "Kubernetes labels"} \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4`).argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--file <json>", "\uACF5\uC2DD API payload JSON \uD30C\uC77C").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, nodegroup, _opts, cmd) => {
|
|
7679
7860
|
const opts = cmd.optsWithGlobals();
|
|
7680
7861
|
const payload = await readJsonFile(opts.file);
|
|
7681
7862
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7691,10 +7872,10 @@ function patchPayloadCommand(name) {
|
|
|
7691
7872
|
uuidOutput2(opts, result, name);
|
|
7692
7873
|
});
|
|
7693
7874
|
}
|
|
7694
|
-
var nodegroupCommand = new
|
|
7875
|
+
var nodegroupCommand = new import_commander45.Command("nodegroup").description("NKS \uB178\uB4DC \uADF8\uB8F9 \uAD00\uB828 \uBA85\uB839").addCommand(listCommand7).addCommand(getCommand5).addCommand(createCommand5).addCommand(deleteCommand4).addCommand(nodeActionCommand("stop-node")).addCommand(nodeActionCommand("start-node")).addCommand(autoscaleCommand).addCommand(setAutoscaleCommand).addCommand(setMetricAutoscaleCommand).addCommand(upgradeCommand).addCommand(setUserscriptCommand).addCommand(updateFlavorCommand).addCommand(patchPayloadCommand("set-fip-auto-bind")).addCommand(patchPayloadCommand("set-labels"));
|
|
7695
7876
|
|
|
7696
7877
|
// src/commands/nks/addon.ts
|
|
7697
|
-
var
|
|
7878
|
+
var import_commander46 = require("commander");
|
|
7698
7879
|
function addonTypeRow(addonType) {
|
|
7699
7880
|
return [
|
|
7700
7881
|
addonType.uuid ?? addonType.id ?? addonType.name,
|
|
@@ -7710,7 +7891,7 @@ function addonRow2(addon) {
|
|
|
7710
7891
|
addon.status ?? ""
|
|
7711
7892
|
];
|
|
7712
7893
|
}
|
|
7713
|
-
var addonTypeListCommand = new
|
|
7894
|
+
var addonTypeListCommand = new import_commander46.Command("list").description("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \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) => {
|
|
7714
7895
|
const opts = cmd.optsWithGlobals();
|
|
7715
7896
|
const { client } = await resolveNksClient(opts);
|
|
7716
7897
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7729,7 +7910,7 @@ var addonTypeListCommand = new import_commander44.Command("list").description("N
|
|
|
7729
7910
|
ids: addonTypes.map((addonType) => addonType.uuid ?? addonType.id ?? addonType.name)
|
|
7730
7911
|
});
|
|
7731
7912
|
});
|
|
7732
|
-
var addonTypeGetCommand = new
|
|
7913
|
+
var addonTypeGetCommand = new import_commander46.Command("get").description("NKS \uC560\uB4DC\uC628 \uD0C0\uC785\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<addon-type>", "\uC560\uB4DC\uC628 \uD0C0\uC785 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 (addonType, _opts, cmd) => {
|
|
7733
7914
|
const opts = cmd.optsWithGlobals();
|
|
7734
7915
|
const { client } = await resolveNksClient(opts);
|
|
7735
7916
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uC870\uD68C \uC911...");
|
|
@@ -7748,8 +7929,8 @@ var addonTypeGetCommand = new import_commander44.Command("get").description("NKS
|
|
|
7748
7929
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
7749
7930
|
});
|
|
7750
7931
|
});
|
|
7751
|
-
var addonTypeCommand = new
|
|
7752
|
-
var addonListCommand = new
|
|
7932
|
+
var addonTypeCommand = new import_commander46.Command("addon-type").description("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uAD00\uB828 \uBA85\uB839").addCommand(addonTypeListCommand).addCommand(addonTypeGetCommand);
|
|
7933
|
+
var addonListCommand = new import_commander46.Command("list").description("NKS \uC560\uB4DC\uC628 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--k8s-version <version>", "Kubernetes version filter").option("--image <image>", "image filter").option("--platform-version <version>", "platform version filter").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) => {
|
|
7753
7934
|
const opts = cmd.optsWithGlobals();
|
|
7754
7935
|
const { client } = await resolveNksClient(opts);
|
|
7755
7936
|
startSpinner("NKS \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7772,7 +7953,7 @@ var addonListCommand = new import_commander44.Command("list").description("NKS \
|
|
|
7772
7953
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
7773
7954
|
});
|
|
7774
7955
|
});
|
|
7775
|
-
var addonGetCommand = new
|
|
7956
|
+
var addonGetCommand = new import_commander46.Command("get").description("NKS \uC560\uB4DC\uC628\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<addon>", "\uC560\uB4DC\uC628 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 (addon, _opts, cmd) => {
|
|
7776
7957
|
const opts = cmd.optsWithGlobals();
|
|
7777
7958
|
const { client } = await resolveNksClient(opts);
|
|
7778
7959
|
startSpinner("NKS \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -7791,11 +7972,11 @@ var addonGetCommand = new import_commander44.Command("get").description("NKS \uC
|
|
|
7791
7972
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
7792
7973
|
});
|
|
7793
7974
|
});
|
|
7794
|
-
var addonCommand = new
|
|
7975
|
+
var addonCommand = new import_commander46.Command("addon").description("NKS \uC560\uB4DC\uC628 \uAD00\uB828 \uBA85\uB839").addCommand(addonListCommand).addCommand(addonGetCommand);
|
|
7795
7976
|
|
|
7796
7977
|
// src/commands/ncs/template.ts
|
|
7797
|
-
var
|
|
7798
|
-
var
|
|
7978
|
+
var import_commander47 = require("commander");
|
|
7979
|
+
var import_chalk16 = __toESM(require("chalk"));
|
|
7799
7980
|
|
|
7800
7981
|
// src/commands/ncs/helpers.ts
|
|
7801
7982
|
var import_node_fs9 = require("fs");
|
|
@@ -7900,29 +8081,18 @@ function normalizeNcsTimeRange(from, to, now) {
|
|
|
7900
8081
|
...normalizedTo === void 0 ? {} : { to: normalizedTo.value }
|
|
7901
8082
|
};
|
|
7902
8083
|
}
|
|
7903
|
-
async function resolveNcsAppKey(profileName
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
if (!(err instanceof NhnCloudCliError) || err.exitCode !== EXIT_CONFIG_ERROR) {
|
|
7910
|
-
throw err;
|
|
7911
|
-
}
|
|
7912
|
-
}
|
|
7913
|
-
if (!cred?.appkey) {
|
|
7914
|
-
throw new NhnCloudCliError(
|
|
7915
|
-
"NCS appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure (\uB610\uB294 --ncs-appkey) \uB85C \uC124\uC815\uD558\uAC70\uB098\n--app-key \uB85C \uC9C1\uC811 \uB118\uAE30\uC138\uC694.",
|
|
7916
|
-
EXIT_CONFIG_ERROR
|
|
7917
|
-
);
|
|
7918
|
-
}
|
|
7919
|
-
return cred.appkey;
|
|
8084
|
+
async function resolveNcsAppKey(profileName) {
|
|
8085
|
+
return resolveServiceAppKey(
|
|
8086
|
+
"ncs",
|
|
8087
|
+
profileName,
|
|
8088
|
+
"NCS appKey \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure --ncs-appkey <key> \uB97C \uC2E4\uD589\uD574 \uC124\uC815\uD558\uC138\uC694."
|
|
8089
|
+
);
|
|
7920
8090
|
}
|
|
7921
8091
|
async function resolveNcsClient(opts) {
|
|
7922
8092
|
const profileName = await resolveProfileName(opts.profile);
|
|
7923
8093
|
const uak = await getUserAccessKey(profileName);
|
|
7924
8094
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
7925
|
-
const appKey = await resolveNcsAppKey(profileName
|
|
8095
|
+
const appKey = await resolveNcsAppKey(profileName);
|
|
7926
8096
|
const region = opts.region ?? "kr1";
|
|
7927
8097
|
return { client: new NcsClient(accessToken, region, appKey), profileName };
|
|
7928
8098
|
}
|
|
@@ -7978,7 +8148,7 @@ async function confirmDestructive(message, yes) {
|
|
|
7978
8148
|
}
|
|
7979
8149
|
|
|
7980
8150
|
// src/commands/ncs/template.ts
|
|
7981
|
-
var listCommand8 = new
|
|
8151
|
+
var listCommand8 = new import_commander47.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
8152
|
const opts = cmd.optsWithGlobals();
|
|
7983
8153
|
const { client } = await resolveNcsClient(opts);
|
|
7984
8154
|
startSpinner("NCS \uC124\uACC4\uB3C4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8009,7 +8179,7 @@ var listCommand8 = new import_commander45.Command("list").description("NCS \uC12
|
|
|
8009
8179
|
ids: templates.map((t) => t.id)
|
|
8010
8180
|
});
|
|
8011
8181
|
});
|
|
8012
|
-
var getCommand6 = new
|
|
8182
|
+
var getCommand6 = new import_commander47.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
8183
|
const opts = cmd.optsWithGlobals();
|
|
8014
8184
|
requireNonEmpty(id, "id");
|
|
8015
8185
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8037,7 +8207,7 @@ var getCommand6 = new import_commander45.Command("get").description("NCS \uC124\
|
|
|
8037
8207
|
ids: [template.id]
|
|
8038
8208
|
});
|
|
8039
8209
|
});
|
|
8040
|
-
var createCommand6 = new
|
|
8210
|
+
var createCommand6 = new import_commander47.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
8211
|
const opts = cmd.optsWithGlobals();
|
|
8042
8212
|
const payload = readJsonPayload(opts.file);
|
|
8043
8213
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8065,12 +8235,12 @@ var createCommand6 = new import_commander45.Command("create").description("NCS \
|
|
|
8065
8235
|
ids: [template.id]
|
|
8066
8236
|
});
|
|
8067
8237
|
});
|
|
8068
|
-
var deleteCommand5 = new
|
|
8238
|
+
var deleteCommand5 = new import_commander47.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
8239
|
const opts = cmd.optsWithGlobals();
|
|
8070
8240
|
requireNonEmpty(id, "id");
|
|
8071
8241
|
const ok = await confirmDestructive(`NCS \uC124\uACC4\uB3C4 "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
8072
8242
|
if (!ok) {
|
|
8073
|
-
process.stderr.write(
|
|
8243
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8074
8244
|
return;
|
|
8075
8245
|
}
|
|
8076
8246
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8082,10 +8252,10 @@ var deleteCommand5 = new import_commander45.Command("delete").description("NCS \
|
|
|
8082
8252
|
throw err;
|
|
8083
8253
|
}
|
|
8084
8254
|
stopSpinner(true);
|
|
8085
|
-
process.stderr.write(
|
|
8255
|
+
process.stderr.write(import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8086
8256
|
`));
|
|
8087
8257
|
});
|
|
8088
|
-
var versionListCommand = new
|
|
8258
|
+
var versionListCommand = new import_commander47.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
8259
|
const opts = cmd.optsWithGlobals();
|
|
8090
8260
|
requireNonEmpty(id, "id");
|
|
8091
8261
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8118,7 +8288,7 @@ var versionListCommand = new import_commander45.Command("list").description("NCS
|
|
|
8118
8288
|
ids: versions.map((v) => v.id)
|
|
8119
8289
|
});
|
|
8120
8290
|
});
|
|
8121
|
-
var versionGetCommand = new
|
|
8291
|
+
var versionGetCommand = new import_commander47.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
8292
|
const opts = cmd.optsWithGlobals();
|
|
8123
8293
|
requireNonEmpty(id, "id");
|
|
8124
8294
|
requireNonEmpty(version, "version");
|
|
@@ -8139,7 +8309,7 @@ var versionGetCommand = new import_commander45.Command("get").description("NCS \
|
|
|
8139
8309
|
ids: [detail.id]
|
|
8140
8310
|
});
|
|
8141
8311
|
});
|
|
8142
|
-
var versionCreateCommand = new
|
|
8312
|
+
var versionCreateCommand = new import_commander47.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
8313
|
const opts = cmd.optsWithGlobals();
|
|
8144
8314
|
requireNonEmpty(id, "id");
|
|
8145
8315
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8160,7 +8330,7 @@ var versionCreateCommand = new import_commander45.Command("create").description(
|
|
|
8160
8330
|
ids: [version.id]
|
|
8161
8331
|
});
|
|
8162
8332
|
});
|
|
8163
|
-
var versionDeleteCommand = new
|
|
8333
|
+
var versionDeleteCommand = new import_commander47.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
8334
|
const opts = cmd.optsWithGlobals();
|
|
8165
8335
|
requireNonEmpty(id, "id");
|
|
8166
8336
|
requireNonEmpty(version, "version");
|
|
@@ -8169,7 +8339,7 @@ var versionDeleteCommand = new import_commander45.Command("delete").description(
|
|
|
8169
8339
|
opts.yes
|
|
8170
8340
|
);
|
|
8171
8341
|
if (!ok) {
|
|
8172
|
-
process.stderr.write(
|
|
8342
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8173
8343
|
return;
|
|
8174
8344
|
}
|
|
8175
8345
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8182,16 +8352,16 @@ var versionDeleteCommand = new import_commander45.Command("delete").description(
|
|
|
8182
8352
|
}
|
|
8183
8353
|
stopSpinner(true);
|
|
8184
8354
|
process.stderr.write(
|
|
8185
|
-
|
|
8355
|
+
import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uBC84\uC804 "${version}" \uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8186
8356
|
`)
|
|
8187
8357
|
);
|
|
8188
8358
|
});
|
|
8189
|
-
var versionCommand = new
|
|
8190
|
-
var templateCommand = new
|
|
8359
|
+
var versionCommand = new import_commander47.Command("version").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uAD00\uB9AC").addCommand(versionListCommand).addCommand(versionGetCommand).addCommand(versionCreateCommand).addCommand(versionDeleteCommand);
|
|
8360
|
+
var templateCommand = new import_commander47.Command("template").description("NCS \uC124\uACC4\uB3C4(template) \uAD00\uB9AC").addCommand(listCommand8).addCommand(getCommand6).addCommand(createCommand6).addCommand(deleteCommand5).addCommand(versionCommand);
|
|
8191
8361
|
|
|
8192
8362
|
// src/commands/ncs/workload.ts
|
|
8193
|
-
var
|
|
8194
|
-
var
|
|
8363
|
+
var import_commander48 = require("commander");
|
|
8364
|
+
var import_chalk17 = __toESM(require("chalk"));
|
|
8195
8365
|
function workloadRows(w) {
|
|
8196
8366
|
return [
|
|
8197
8367
|
[
|
|
@@ -8205,7 +8375,7 @@ function workloadRows(w) {
|
|
|
8205
8375
|
];
|
|
8206
8376
|
}
|
|
8207
8377
|
var WORKLOAD_HEADERS = ["id", "name", "type", "status", "desired", "available"];
|
|
8208
|
-
var listCommand9 = new
|
|
8378
|
+
var listCommand9 = new import_commander48.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
8379
|
const opts = cmd.optsWithGlobals();
|
|
8210
8380
|
const { client } = await resolveNcsClient(opts);
|
|
8211
8381
|
startSpinner("NCS workload \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8238,7 +8408,7 @@ var listCommand9 = new import_commander46.Command("list").description("NCS workl
|
|
|
8238
8408
|
ids: workloads.map((w) => w.id)
|
|
8239
8409
|
});
|
|
8240
8410
|
});
|
|
8241
|
-
var getCommand7 = new
|
|
8411
|
+
var getCommand7 = new import_commander48.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
8412
|
const opts = cmd.optsWithGlobals();
|
|
8243
8413
|
requireNonEmpty(id, "id");
|
|
8244
8414
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8268,7 +8438,7 @@ var getCommand7 = new import_commander46.Command("get").description("NCS workloa
|
|
|
8268
8438
|
ids: [workload.id]
|
|
8269
8439
|
});
|
|
8270
8440
|
});
|
|
8271
|
-
var logsCommand = new
|
|
8441
|
+
var logsCommand = new import_commander48.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
8442
|
"--from <time>",
|
|
8273
8443
|
"\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
8444
|
).option(
|
|
@@ -8313,7 +8483,7 @@ var logsCommand = new import_commander46.Command("logs").description("NCS worklo
|
|
|
8313
8483
|
ids: []
|
|
8314
8484
|
});
|
|
8315
8485
|
});
|
|
8316
|
-
var eventsCommand2 = new
|
|
8486
|
+
var eventsCommand2 = new import_commander48.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
8487
|
"--from <time>",
|
|
8318
8488
|
"\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
8489
|
).option(
|
|
@@ -8355,7 +8525,7 @@ var eventsCommand2 = new import_commander46.Command("events").description("NCS w
|
|
|
8355
8525
|
ids: []
|
|
8356
8526
|
});
|
|
8357
8527
|
});
|
|
8358
|
-
var historyGetCommand = new
|
|
8528
|
+
var historyGetCommand = new import_commander48.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
8529
|
const opts = cmd.optsWithGlobals();
|
|
8360
8530
|
requireNonEmpty(id, "id");
|
|
8361
8531
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8384,7 +8554,7 @@ var historyGetCommand = new import_commander46.Command("get").description("NCS w
|
|
|
8384
8554
|
ids: [String(detail.id)]
|
|
8385
8555
|
});
|
|
8386
8556
|
});
|
|
8387
|
-
var historyCommand = new
|
|
8557
|
+
var historyCommand = new import_commander48.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
8558
|
const opts = cmd.optsWithGlobals();
|
|
8389
8559
|
requireNonEmpty(id, "id");
|
|
8390
8560
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8417,7 +8587,7 @@ var historyCommand = new import_commander46.Command("history").description("NCS
|
|
|
8417
8587
|
ids: history.map((h) => String(h.id))
|
|
8418
8588
|
});
|
|
8419
8589
|
}).addCommand(historyGetCommand);
|
|
8420
|
-
var scheduleHistoryCommand = new
|
|
8590
|
+
var scheduleHistoryCommand = new import_commander48.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
8591
|
const opts = cmd.optsWithGlobals();
|
|
8422
8592
|
requireNonEmpty(id, "id");
|
|
8423
8593
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8438,7 +8608,7 @@ var scheduleHistoryCommand = new import_commander46.Command("schedule-history").
|
|
|
8438
8608
|
ids: scheduleHistory.map((s) => s.id)
|
|
8439
8609
|
});
|
|
8440
8610
|
});
|
|
8441
|
-
var createCommand7 = new
|
|
8611
|
+
var createCommand7 = new import_commander48.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
8612
|
const opts = cmd.optsWithGlobals();
|
|
8443
8613
|
const payload = readJsonPayload(opts.file);
|
|
8444
8614
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
@@ -8469,7 +8639,7 @@ var createCommand7 = new import_commander46.Command("create").description("NCS w
|
|
|
8469
8639
|
ids: [workload.id]
|
|
8470
8640
|
});
|
|
8471
8641
|
});
|
|
8472
|
-
var updateCommand = new
|
|
8642
|
+
var updateCommand = new import_commander48.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
8643
|
const opts = cmd.optsWithGlobals();
|
|
8474
8644
|
requireNonEmpty(id, "id");
|
|
8475
8645
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8490,7 +8660,7 @@ var updateCommand = new import_commander46.Command("update").description("NCS wo
|
|
|
8490
8660
|
ids: [workload.id]
|
|
8491
8661
|
});
|
|
8492
8662
|
});
|
|
8493
|
-
var patchCommand = new
|
|
8663
|
+
var patchCommand = new import_commander48.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
8664
|
const opts = cmd.optsWithGlobals();
|
|
8495
8665
|
requireNonEmpty(id, "id");
|
|
8496
8666
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8511,7 +8681,7 @@ var patchCommand = new import_commander46.Command("patch").description("NCS work
|
|
|
8511
8681
|
ids: [workload.id]
|
|
8512
8682
|
});
|
|
8513
8683
|
});
|
|
8514
|
-
var pauseCommand = new
|
|
8684
|
+
var pauseCommand = new import_commander48.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
8685
|
const opts = cmd.optsWithGlobals();
|
|
8516
8686
|
requireNonEmpty(id, "id");
|
|
8517
8687
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8523,10 +8693,10 @@ var pauseCommand = new import_commander46.Command("pause").description("NCS work
|
|
|
8523
8693
|
throw err;
|
|
8524
8694
|
}
|
|
8525
8695
|
stopSpinner(true);
|
|
8526
|
-
process.stderr.write(
|
|
8696
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC77C\uC2DC\uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8527
8697
|
`));
|
|
8528
8698
|
});
|
|
8529
|
-
var resumeCommand = new
|
|
8699
|
+
var resumeCommand = new import_commander48.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
8700
|
const opts = cmd.optsWithGlobals();
|
|
8531
8701
|
requireNonEmpty(id, "id");
|
|
8532
8702
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8538,10 +8708,10 @@ var resumeCommand = new import_commander46.Command("resume").description("NCS wo
|
|
|
8538
8708
|
throw err;
|
|
8539
8709
|
}
|
|
8540
8710
|
stopSpinner(true);
|
|
8541
|
-
process.stderr.write(
|
|
8711
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC7AC\uAC1C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8542
8712
|
`));
|
|
8543
8713
|
});
|
|
8544
|
-
var restartCommand = new
|
|
8714
|
+
var restartCommand = new import_commander48.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
8715
|
const opts = cmd.optsWithGlobals();
|
|
8546
8716
|
requireNonEmpty(id, "id");
|
|
8547
8717
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -8560,16 +8730,16 @@ var restartCommand = new import_commander46.Command("restart").description("NCS
|
|
|
8560
8730
|
}
|
|
8561
8731
|
stopSpinner(true);
|
|
8562
8732
|
process.stderr.write(
|
|
8563
|
-
|
|
8733
|
+
import_chalk17.default.green(`\u2713 NCS workload "${id}" task "${opts.task}" \uAC00 \uC7AC\uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8564
8734
|
`)
|
|
8565
8735
|
);
|
|
8566
8736
|
});
|
|
8567
|
-
var deleteCommand6 = new
|
|
8737
|
+
var deleteCommand6 = new import_commander48.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
8738
|
const opts = cmd.optsWithGlobals();
|
|
8569
8739
|
requireNonEmpty(id, "id");
|
|
8570
8740
|
const ok = await confirmDestructive(`NCS workload "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
8571
8741
|
if (!ok) {
|
|
8572
|
-
process.stderr.write(
|
|
8742
|
+
process.stderr.write(import_chalk17.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
8573
8743
|
return;
|
|
8574
8744
|
}
|
|
8575
8745
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8581,13 +8751,13 @@ var deleteCommand6 = new import_commander46.Command("delete").description("NCS w
|
|
|
8581
8751
|
throw err;
|
|
8582
8752
|
}
|
|
8583
8753
|
stopSpinner(true);
|
|
8584
|
-
process.stderr.write(
|
|
8754
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8585
8755
|
`));
|
|
8586
8756
|
});
|
|
8587
|
-
var workloadCommand = new
|
|
8757
|
+
var workloadCommand = new import_commander48.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);
|
|
8588
8758
|
|
|
8589
8759
|
// src/commands/ncs/malware.ts
|
|
8590
|
-
var
|
|
8760
|
+
var import_commander49 = require("commander");
|
|
8591
8761
|
function parseEnabledOption(value) {
|
|
8592
8762
|
if (value === "true") return true;
|
|
8593
8763
|
if (value === "false") return false;
|
|
@@ -8596,7 +8766,7 @@ function parseEnabledOption(value) {
|
|
|
8596
8766
|
EXIT_PARAM_ERROR
|
|
8597
8767
|
);
|
|
8598
8768
|
}
|
|
8599
|
-
var configGetCommand = new
|
|
8769
|
+
var configGetCommand = new import_commander49.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
8770
|
const opts = cmd.optsWithGlobals();
|
|
8601
8771
|
const { client } = await resolveNcsClient(opts);
|
|
8602
8772
|
startSpinner("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uC870\uD68C \uC911...");
|
|
@@ -8615,7 +8785,7 @@ var configGetCommand = new import_commander47.Command("get").description("NCS \u
|
|
|
8615
8785
|
ids: []
|
|
8616
8786
|
});
|
|
8617
8787
|
});
|
|
8618
|
-
var configSetCommand = new
|
|
8788
|
+
var configSetCommand = new import_commander49.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
8789
|
const opts = cmd.optsWithGlobals();
|
|
8620
8790
|
const enabled = parseEnabledOption(opts.enabled);
|
|
8621
8791
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8635,8 +8805,8 @@ var configSetCommand = new import_commander47.Command("set").description("NCS \u
|
|
|
8635
8805
|
ids: []
|
|
8636
8806
|
});
|
|
8637
8807
|
});
|
|
8638
|
-
var configCommand = new
|
|
8639
|
-
var resultCommand = new
|
|
8808
|
+
var configCommand = new import_commander49.Command("config").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uAD00\uB9AC").addCommand(configGetCommand).addCommand(configSetCommand);
|
|
8809
|
+
var resultCommand = new import_commander49.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
8810
|
const opts = cmd.optsWithGlobals();
|
|
8641
8811
|
requireNonEmpty(workloadId, "workloadId");
|
|
8642
8812
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8667,10 +8837,10 @@ var resultCommand = new import_commander47.Command("result").description("NCS wo
|
|
|
8667
8837
|
ids: []
|
|
8668
8838
|
});
|
|
8669
8839
|
});
|
|
8670
|
-
var malwareCommand = new
|
|
8840
|
+
var malwareCommand = new import_commander49.Command("malware").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uAD00\uB9AC").addCommand(configCommand).addCommand(resultCommand);
|
|
8671
8841
|
|
|
8672
8842
|
// src/commands/apigateway/service.ts
|
|
8673
|
-
var
|
|
8843
|
+
var import_commander50 = require("commander");
|
|
8674
8844
|
|
|
8675
8845
|
// src/commands/apigateway/helpers.ts
|
|
8676
8846
|
var import_promises8 = require("fs/promises");
|
|
@@ -9352,21 +9522,11 @@ function writtenStageResourceOutput(resources) {
|
|
|
9352
9522
|
};
|
|
9353
9523
|
}
|
|
9354
9524
|
async function resolveApiGatewayAppKey(profileName) {
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
throw err;
|
|
9361
|
-
}
|
|
9362
|
-
}
|
|
9363
|
-
if (!credential?.appkey) {
|
|
9364
|
-
throw new NhnCloudCliError(
|
|
9365
|
-
"API Gateway appKey\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure --apigateway-appkey <key>\uB85C \uC124\uC815\uD558\uC138\uC694.",
|
|
9366
|
-
EXIT_CONFIG_ERROR
|
|
9367
|
-
);
|
|
9368
|
-
}
|
|
9369
|
-
return credential.appkey;
|
|
9525
|
+
return resolveServiceAppKey(
|
|
9526
|
+
"apigateway",
|
|
9527
|
+
profileName,
|
|
9528
|
+
"API Gateway appKey\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. nhncloud configure --apigateway-appkey <key>\uB85C \uC124\uC815\uD558\uC138\uC694."
|
|
9529
|
+
);
|
|
9370
9530
|
}
|
|
9371
9531
|
async function resolveApiGatewayClient(opts) {
|
|
9372
9532
|
const profileName = await resolveProfileName(opts.profile);
|
|
@@ -9380,7 +9540,7 @@ async function resolveApiGatewayClient(opts) {
|
|
|
9380
9540
|
}
|
|
9381
9541
|
|
|
9382
9542
|
// src/commands/apigateway/service.ts
|
|
9383
|
-
var listCommand10 = new
|
|
9543
|
+
var listCommand10 = new import_commander50.Command("list").description("API Gateway service \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, command) => {
|
|
9384
9544
|
const opts = command.optsWithGlobals();
|
|
9385
9545
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9386
9546
|
startSpinner("API Gateway service \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -9411,7 +9571,7 @@ var listCommand10 = new import_commander48.Command("list").description("API Gate
|
|
|
9411
9571
|
ids: services.map((service) => sanitizeForTerminal(service.apigwServiceId))
|
|
9412
9572
|
});
|
|
9413
9573
|
});
|
|
9414
|
-
var getCommand8 = new
|
|
9574
|
+
var getCommand8 = new import_commander50.Command("get").description("API Gateway service \uD55C \uAC74\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (serviceId, _opts, command) => {
|
|
9415
9575
|
const opts = command.optsWithGlobals();
|
|
9416
9576
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
9417
9577
|
const displayServiceId = sanitizeForTerminal(parsedServiceId);
|
|
@@ -9444,10 +9604,10 @@ var getCommand8 = new import_commander48.Command("get").description("API Gateway
|
|
|
9444
9604
|
ids: [sanitizeForTerminal(service.apigwServiceId)]
|
|
9445
9605
|
});
|
|
9446
9606
|
});
|
|
9447
|
-
var serviceCommand = new
|
|
9607
|
+
var serviceCommand = new import_commander50.Command("service").description("API Gateway service \uC870\uD68C \uBA85\uB839").addCommand(listCommand10).addCommand(getCommand8);
|
|
9448
9608
|
|
|
9449
9609
|
// src/commands/apigateway/resource.ts
|
|
9450
|
-
var
|
|
9610
|
+
var import_commander51 = require("commander");
|
|
9451
9611
|
function addApiGatewayOptions(command) {
|
|
9452
9612
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
9453
9613
|
}
|
|
@@ -9529,7 +9689,7 @@ function updatedResourceOutput(opts, resources) {
|
|
|
9529
9689
|
});
|
|
9530
9690
|
}
|
|
9531
9691
|
var listCommand11 = addApiGatewayOptions(
|
|
9532
|
-
new
|
|
9692
|
+
new import_commander51.Command("list").description("API Gateway resource \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID")
|
|
9533
9693
|
).action(async (serviceId, _opts, command) => {
|
|
9534
9694
|
const opts = command.optsWithGlobals();
|
|
9535
9695
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9558,7 +9718,7 @@ var listCommand11 = addApiGatewayOptions(
|
|
|
9558
9718
|
});
|
|
9559
9719
|
});
|
|
9560
9720
|
var parametersCommand = addApiGatewayOptions(
|
|
9561
|
-
new
|
|
9721
|
+
new import_commander51.Command("parameters").description("API Gateway resource \uC694\uCCAD parameter\uB97C \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID")
|
|
9562
9722
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9563
9723
|
const opts = command.optsWithGlobals();
|
|
9564
9724
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9587,7 +9747,7 @@ var parametersCommand = addApiGatewayOptions(
|
|
|
9587
9747
|
});
|
|
9588
9748
|
});
|
|
9589
9749
|
var responsesCommand = addApiGatewayOptions(
|
|
9590
|
-
new
|
|
9750
|
+
new import_commander51.Command("responses").description("API Gateway resource \uC751\uB2F5 \uC815\uC758\uB97C \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID")
|
|
9591
9751
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9592
9752
|
const opts = command.optsWithGlobals();
|
|
9593
9753
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9613,7 +9773,7 @@ var responsesCommand = addApiGatewayOptions(
|
|
|
9613
9773
|
});
|
|
9614
9774
|
});
|
|
9615
9775
|
var setPathPluginCommand = addApiGatewayOptions(
|
|
9616
|
-
new
|
|
9776
|
+
new import_commander51.Command("set-path-plugin").description("API Gateway resource \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778\uC744 \uC124\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID").requiredOption("--config-file <path>", "\uD50C\uB7EC\uADF8\uC778 \uC124\uC815 JSON \uD30C\uC77C").option("--dry-run", "\uC4F0\uAE30 \uC5C6\uC774 \uC608\uC0C1 \uC601\uD5A5 \uBC94\uC704\uB97C \uCD9C\uB825\uD55C\uB2E4").option("--yes", "\uB9AC\uC18C\uC2A4 \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC124\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
9617
9777
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9618
9778
|
const opts = command.optsWithGlobals();
|
|
9619
9779
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9687,7 +9847,7 @@ var setPathPluginCommand = addApiGatewayOptions(
|
|
|
9687
9847
|
updatedResourceOutput(opts, updatedResources);
|
|
9688
9848
|
});
|
|
9689
9849
|
var setMethodPluginCommand = addApiGatewayOptions(
|
|
9690
|
-
new
|
|
9850
|
+
new import_commander51.Command("set-method-plugin").description("API Gateway resource \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778\uC744 \uC124\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID").requiredOption("--config-file <path>", "\uD50C\uB7EC\uADF8\uC778 \uC124\uC815 JSON \uD30C\uC77C").option("--dry-run", "\uC4F0\uAE30 \uC5C6\uC774 \uC608\uC0C1 \uBCC0\uACBD \uB0B4\uC6A9\uC744 \uCD9C\uB825\uD55C\uB2E4").option("--yes", "\uB9AC\uC18C\uC2A4 \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC124\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
9691
9851
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9692
9852
|
const opts = command.optsWithGlobals();
|
|
9693
9853
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9775,19 +9935,19 @@ var setMethodPluginCommand = addApiGatewayOptions(
|
|
|
9775
9935
|
}
|
|
9776
9936
|
updatedResourceOutput(opts, updatedResources);
|
|
9777
9937
|
});
|
|
9778
|
-
var resourceCommand = new
|
|
9938
|
+
var resourceCommand = new import_commander51.Command("resource").description("API Gateway resource \uC870\uD68C \uBC0F \uBCC0\uACBD \uBA85\uB839").addCommand(listCommand11).addCommand(parametersCommand).addCommand(responsesCommand).addCommand(setPathPluginCommand).addCommand(setMethodPluginCommand);
|
|
9779
9939
|
|
|
9780
9940
|
// src/commands/apigateway/stage.ts
|
|
9781
9941
|
var import_promises9 = require("fs/promises");
|
|
9782
|
-
var
|
|
9942
|
+
var import_commander53 = require("commander");
|
|
9783
9943
|
|
|
9784
9944
|
// src/commands/apigateway/deploy.ts
|
|
9785
|
-
var
|
|
9945
|
+
var import_commander52 = require("commander");
|
|
9786
9946
|
function addApiGatewayOptions2(command) {
|
|
9787
9947
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
9788
9948
|
}
|
|
9789
9949
|
var listCommand12 = addApiGatewayOptions2(
|
|
9790
|
-
new
|
|
9950
|
+
new import_commander52.Command("list").description("API Gateway stage \uBC30\uD3EC \uC774\uB825 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
9791
9951
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
9792
9952
|
const opts = command.optsWithGlobals();
|
|
9793
9953
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9816,7 +9976,7 @@ var listCommand12 = addApiGatewayOptions2(
|
|
|
9816
9976
|
});
|
|
9817
9977
|
});
|
|
9818
9978
|
var latestCommand = addApiGatewayOptions2(
|
|
9819
|
-
new
|
|
9979
|
+
new import_commander52.Command("latest").description("API Gateway stage \uCD5C\uC2E0 \uBC30\uD3EC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4 (resource \uC804\uCCB4\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
9820
9980
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
9821
9981
|
const opts = command.optsWithGlobals();
|
|
9822
9982
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9846,7 +10006,7 @@ var latestCommand = addApiGatewayOptions2(
|
|
|
9846
10006
|
});
|
|
9847
10007
|
});
|
|
9848
10008
|
var createCommand8 = addApiGatewayOptions2(
|
|
9849
|
-
new
|
|
10009
|
+
new import_commander52.Command("create").description("stage \uC124\uC815\uC744 API Gateway service \uC5D0 \uBC30\uD3EC\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--description <text>", "\uBC30\uD3EC \uC124\uBA85 (\uCD5C\uB300 200\uC790)").option("--no-wait", "\uBC30\uD3EC \uACB0\uACFC\uB97C \uAE30\uB2E4\uB9AC\uC9C0 \uC54A\uACE0 \uC694\uCCAD\uB9CC \uD55C\uB2E4").option("--timeout <sec>", "\uBC30\uD3EC \uB300\uAE30 \uC0C1\uD55C (\uCD08, \uAE30\uBCF8 300)", "300").option("--yes", "\uBC30\uD3EC\uB97C \uD655\uC778\uD55C\uB2E4")
|
|
9850
10010
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
9851
10011
|
const opts = command.optsWithGlobals();
|
|
9852
10012
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9944,7 +10104,7 @@ var createCommand8 = addApiGatewayOptions2(
|
|
|
9944
10104
|
});
|
|
9945
10105
|
});
|
|
9946
10106
|
var rollbackCommand = addApiGatewayOptions2(
|
|
9947
|
-
new
|
|
10107
|
+
new import_commander52.Command("rollback").description("\uBC30\uD3EC \uC774\uB825\uC73C\uB85C stage \uC124\uC815\uC744 \uB418\uB3CC\uB9B0\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").argument("<deploy-id>", "\uB418\uB3CC\uB9B4 \uBC30\uD3EC ID").option("--yes", "\uB418\uB3CC\uB9AC\uAE30\uB97C \uD655\uC778\uD55C\uB2E4")
|
|
9948
10108
|
).action(async (serviceId, stageId, deployId, _opts, command) => {
|
|
9949
10109
|
const opts = command.optsWithGlobals();
|
|
9950
10110
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9972,7 +10132,7 @@ var rollbackCommand = addApiGatewayOptions2(
|
|
|
9972
10132
|
);
|
|
9973
10133
|
process.stderr.write("\uC644\uB8CC: \uC9C1\uC804\uAE4C\uC9C0\uC758 \uC2A4\uD14C\uC774\uC9C0 \uC124\uC815\uC740 \uC774 \uBC30\uD3EC \uC774\uB825\uC758 \uB0B4\uC6A9\uC73C\uB85C \uB300\uCCB4\uB410\uC2B5\uB2C8\uB2E4.\n");
|
|
9974
10134
|
});
|
|
9975
|
-
var deployCommand = new
|
|
10135
|
+
var deployCommand = new import_commander52.Command("deploy").description("API Gateway stage \uBC30\uD3EC \uC870\uD68C\uC640 \uC2E4\uD589 \uBA85\uB839").addCommand(listCommand12).addCommand(latestCommand).addCommand(createCommand8).addCommand(rollbackCommand);
|
|
9976
10136
|
|
|
9977
10137
|
// src/commands/apigateway/stage.ts
|
|
9978
10138
|
function addApiGatewayOptions3(command) {
|
|
@@ -10001,7 +10161,7 @@ async function writeStageSwaggerFile(path5, swagger, force) {
|
|
|
10001
10161
|
}
|
|
10002
10162
|
}
|
|
10003
10163
|
var listCommand13 = addApiGatewayOptions3(
|
|
10004
|
-
new
|
|
10164
|
+
new import_commander53.Command("list").description("API Gateway stage \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (resourceUpdatedAt\uC740 \uB9AC\uC18C\uC2A4 \uBC18\uC601 \uC2DC\uAC01)").argument("<service-id>", "API Gateway service ID")
|
|
10005
10165
|
).action(async (serviceId, _opts, command) => {
|
|
10006
10166
|
const opts = command.optsWithGlobals();
|
|
10007
10167
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10030,7 +10190,7 @@ var listCommand13 = addApiGatewayOptions3(
|
|
|
10030
10190
|
});
|
|
10031
10191
|
});
|
|
10032
10192
|
var swaggerCommand = addApiGatewayOptions3(
|
|
10033
|
-
new
|
|
10193
|
+
new import_commander53.Command("swagger").description("API Gateway stage Swagger\uB97C \uCD9C\uB825\uD558\uAC70\uB098 \uC800\uC7A5\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--output <file>", "Swagger JSON \uC800\uC7A5 \uACBD\uB85C").option("--force", "\uAE30\uC874 \uD30C\uC77C \uB36E\uC5B4\uC4F0\uAE30")
|
|
10034
10194
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10035
10195
|
const opts = command.optsWithGlobals();
|
|
10036
10196
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10054,7 +10214,7 @@ var swaggerCommand = addApiGatewayOptions3(
|
|
|
10054
10214
|
printJson(swagger);
|
|
10055
10215
|
});
|
|
10056
10216
|
var resourcesCommand = addApiGatewayOptions3(
|
|
10057
|
-
new
|
|
10217
|
+
new import_commander53.Command("resources").description("\uBC30\uD3EC\uB41C API Gateway stage resource \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
10058
10218
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10059
10219
|
const opts = command.optsWithGlobals();
|
|
10060
10220
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10084,7 +10244,7 @@ var resourcesCommand = addApiGatewayOptions3(
|
|
|
10084
10244
|
});
|
|
10085
10245
|
});
|
|
10086
10246
|
var updateCommand2 = addApiGatewayOptions3(
|
|
10087
|
-
new
|
|
10247
|
+
new import_commander53.Command("update").description("API Gateway stage\uC758 backend endpoint URL\uACFC \uC124\uBA85\uC744 \uC218\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--backend-endpoint-url <url>", "\uBCC0\uACBD\uD560 backend endpoint URL").option("--description <text>", "\uBCC0\uACBD\uD560 stage \uC124\uBA85").option("--yes", "\uC2A4\uD14C\uC774\uC9C0 \uC218\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
10088
10248
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10089
10249
|
const opts = command.optsWithGlobals();
|
|
10090
10250
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10133,7 +10293,7 @@ var updateCommand2 = addApiGatewayOptions3(
|
|
|
10133
10293
|
process.stderr.write("\uC548\uB0B4: \uC2A4\uD14C\uC774\uC9C0 \uBCC0\uACBD \uD6C4 \uC2E4\uC81C \uD2B8\uB798\uD53D \uBC18\uC601 \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uC138\uC694.\n");
|
|
10134
10294
|
});
|
|
10135
10295
|
var importResourcesCommand = addApiGatewayOptions3(
|
|
10136
|
-
new
|
|
10296
|
+
new import_commander53.Command("import-resources").description("API Gateway service \uC758 \uB9AC\uC18C\uC2A4\uB97C stage \uB85C \uAC00\uC838\uC628\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--yes", "\uC2A4\uD14C\uC774\uC9C0 \uBC18\uC601\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
10137
10297
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10138
10298
|
const opts = command.optsWithGlobals();
|
|
10139
10299
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10155,10 +10315,10 @@ var importResourcesCommand = addApiGatewayOptions3(
|
|
|
10155
10315
|
"\uC548\uB0B4: \uBC18\uC601\uC740 \uC2A4\uD14C\uC774\uC9C0 \uC124\uC815\uB9CC \uBC14\uAFC9\uB2C8\uB2E4. \uC11C\uBE44\uC2A4\uC5D0 \uC801\uC6A9\uD558\uB824\uBA74 apigateway stage deploy create \uB97C \uC2E4\uD589\uD558\uC138\uC694.\n"
|
|
10156
10316
|
);
|
|
10157
10317
|
});
|
|
10158
|
-
var stageCommand = new
|
|
10318
|
+
var stageCommand = new import_commander53.Command("stage").description("API Gateway stage \uC870\uD68C \uBC0F \uBCC0\uACBD \uBA85\uB839").addCommand(listCommand13).addCommand(swaggerCommand).addCommand(resourcesCommand).addCommand(updateCommand2).addCommand(importResourcesCommand).addCommand(deployCommand);
|
|
10159
10319
|
|
|
10160
10320
|
// src/commands/loadbalancer/list.ts
|
|
10161
|
-
var
|
|
10321
|
+
var import_commander54 = require("commander");
|
|
10162
10322
|
|
|
10163
10323
|
// src/commands/loadbalancer/helpers.ts
|
|
10164
10324
|
var import_node_net = require("net");
|
|
@@ -10531,7 +10691,7 @@ async function resolveLoadBalancerClient(opts) {
|
|
|
10531
10691
|
}
|
|
10532
10692
|
|
|
10533
10693
|
// src/commands/loadbalancer/list.ts
|
|
10534
|
-
var listCommand14 = new
|
|
10694
|
+
var listCommand14 = new import_commander54.Command("list").description("Load Balancer \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").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) => {
|
|
10535
10695
|
const opts = cmd.optsWithGlobals();
|
|
10536
10696
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
10537
10697
|
startSpinner("Load Balancer \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -10569,8 +10729,8 @@ var listCommand14 = new import_commander52.Command("list").description("Load Bal
|
|
|
10569
10729
|
});
|
|
10570
10730
|
|
|
10571
10731
|
// src/commands/loadbalancer/get.ts
|
|
10572
|
-
var
|
|
10573
|
-
var getCommand9 = new
|
|
10732
|
+
var import_commander55 = require("commander");
|
|
10733
|
+
var getCommand9 = new import_commander55.Command("get").description("Load Balancer\uB97C \uC774\uB984 \uB610\uB294 UUID\uB85C \uC870\uD68C\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").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 (loadBalancerInput, _opts, cmd) => {
|
|
10574
10734
|
const opts = cmd.optsWithGlobals();
|
|
10575
10735
|
const input = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
10576
10736
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10607,10 +10767,10 @@ var getCommand9 = new import_commander53.Command("get").description("Load Balanc
|
|
|
10607
10767
|
});
|
|
10608
10768
|
|
|
10609
10769
|
// src/commands/loadbalancer/ipacl.ts
|
|
10610
|
-
var
|
|
10770
|
+
var import_commander57 = require("commander");
|
|
10611
10771
|
|
|
10612
10772
|
// src/commands/loadbalancer/target.ts
|
|
10613
|
-
var
|
|
10773
|
+
var import_commander56 = require("commander");
|
|
10614
10774
|
|
|
10615
10775
|
// src/commands/loadbalancer/rebind.ts
|
|
10616
10776
|
function shellQuote(value) {
|
|
@@ -10741,7 +10901,7 @@ function targetWriteResult(operation, target, rebind) {
|
|
|
10741
10901
|
rebind
|
|
10742
10902
|
};
|
|
10743
10903
|
}
|
|
10744
|
-
var listCommand15 = new
|
|
10904
|
+
var listCommand15 = new import_commander56.Command("list").description("IP ACL \uB300\uC0C1 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").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 (groupInput, _opts, cmd) => {
|
|
10745
10905
|
const opts = cmd.optsWithGlobals();
|
|
10746
10906
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
10747
10907
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10770,7 +10930,7 @@ var listCommand15 = new import_commander54.Command("list").description("IP ACL \
|
|
|
10770
10930
|
ids: targets.map((target) => target.id)
|
|
10771
10931
|
});
|
|
10772
10932
|
});
|
|
10773
|
-
var addCommand = new
|
|
10933
|
+
var addCommand = new import_commander56.Command("add").description("IP ACL \uB300\uC0C1\uC744 \uCD94\uAC00\uD558\uACE0 \uC5F0\uACB0\uB41C Load Balancer\uB97C \uC7AC\uBC14\uC778\uB529\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").requiredOption("--cidr <ip-or-cidr>", "\uCD94\uAC00\uD560 IP \uC8FC\uC18C \uB610\uB294 CIDR").option("--description <text>", "IP ACL \uB300\uC0C1 \uC124\uBA85").option("--no-rebind", "\uB300\uC0C1 \uCD94\uAC00 \uD6C4 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC0DD\uB7B5").option("--yes", "\uB300\uC0C1 \uCD94\uAC00 \uD655\uC778").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 (groupInput, _opts, cmd) => {
|
|
10774
10934
|
const opts = cmd.optsWithGlobals();
|
|
10775
10935
|
requireYes2(opts.yes, "IP ACL \uB300\uC0C1 \uCD94\uAC00");
|
|
10776
10936
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
@@ -10807,7 +10967,7 @@ var addCommand = new import_commander54.Command("add").description("IP ACL \uB30
|
|
|
10807
10967
|
writeTargetWarnings(group, result);
|
|
10808
10968
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
10809
10969
|
});
|
|
10810
|
-
var removeCommand = new
|
|
10970
|
+
var removeCommand = new import_commander56.Command("remove").description("IP ACL \uB300\uC0C1\uC744 \uC0AD\uC81C\uD558\uACE0 \uC5F0\uACB0\uB41C Load Balancer\uB97C \uC7AC\uBC14\uC778\uB529\uD55C\uB2E4").argument("<target-id>", "\uC0AD\uC81C\uD560 IP ACL \uB300\uC0C1 UUID").option("--no-rebind", "\uB300\uC0C1 \uC0AD\uC81C \uD6C4 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC0DD\uB7B5").option("--yes", "\uB300\uC0C1 \uC0AD\uC81C \uD655\uC778").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 (targetInput, _opts, cmd) => {
|
|
10811
10971
|
const opts = cmd.optsWithGlobals();
|
|
10812
10972
|
requireYes2(opts.yes, "IP ACL \uB300\uC0C1 \uC0AD\uC81C");
|
|
10813
10973
|
const parsedTargetId = requireResourceInput(targetInput, "IP ACL \uB300\uC0C1");
|
|
@@ -10838,13 +10998,13 @@ var removeCommand = new import_commander54.Command("remove").description("IP ACL
|
|
|
10838
10998
|
writeTargetWarnings(group, result);
|
|
10839
10999
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
10840
11000
|
});
|
|
10841
|
-
var targetCommand = new
|
|
11001
|
+
var targetCommand = new import_commander56.Command("target").description("IP ACL \uB300\uC0C1 \uC870\uD68C\xB7\uAD00\uB9AC");
|
|
10842
11002
|
targetCommand.addCommand(listCommand15);
|
|
10843
11003
|
targetCommand.addCommand(addCommand);
|
|
10844
11004
|
targetCommand.addCommand(removeCommand);
|
|
10845
11005
|
|
|
10846
11006
|
// src/commands/loadbalancer/ipacl.ts
|
|
10847
|
-
var listCommand16 = new
|
|
11007
|
+
var listCommand16 = new import_commander57.Command("list").description("IP ACL \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").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) => {
|
|
10848
11008
|
const opts = cmd.optsWithGlobals();
|
|
10849
11009
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
10850
11010
|
startSpinner("IP ACL \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -10872,7 +11032,7 @@ var listCommand16 = new import_commander55.Command("list").description("IP ACL \
|
|
|
10872
11032
|
ids: groups.map((group) => group.id)
|
|
10873
11033
|
});
|
|
10874
11034
|
});
|
|
10875
|
-
var getCommand10 = new
|
|
11035
|
+
var getCommand10 = new import_commander57.Command("get").description("IP ACL \uADF8\uB8F9\uC744 \uC774\uB984 \uB610\uB294 UUID\uB85C \uC870\uD68C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").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 (groupInput, _opts, cmd) => {
|
|
10876
11036
|
const opts = cmd.optsWithGlobals();
|
|
10877
11037
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
10878
11038
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10905,7 +11065,7 @@ var getCommand10 = new import_commander55.Command("get").description("IP ACL \uA
|
|
|
10905
11065
|
ids: [group.id]
|
|
10906
11066
|
});
|
|
10907
11067
|
});
|
|
10908
|
-
var createCommand9 = new
|
|
11068
|
+
var createCommand9 = new import_commander57.Command("create").description("IP ACL \uADF8\uB8F9\uC744 \uC0DD\uC131\uD55C\uB2E4").requiredOption("--name <name>", "IP ACL \uADF8\uB8F9 \uC774\uB984").requiredOption("--action <ALLOW|DENY>", "IP \uC811\uADFC \uC81C\uC5B4 \uB3D9\uC791").option("--description <text>", "IP ACL \uADF8\uB8F9 \uC124\uBA85").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) => {
|
|
10909
11069
|
const opts = cmd.optsWithGlobals();
|
|
10910
11070
|
const parsedName = requireResourceInput(opts.name ?? "", "IP ACL \uADF8\uB8F9");
|
|
10911
11071
|
const parsedAction = parseIpAclAction(opts.action ?? "");
|
|
@@ -10936,7 +11096,7 @@ var createCommand9 = new import_commander55.Command("create").description("IP AC
|
|
|
10936
11096
|
ids: [group.id]
|
|
10937
11097
|
});
|
|
10938
11098
|
});
|
|
10939
|
-
var deleteCommand7 = new
|
|
11099
|
+
var deleteCommand7 = new import_commander57.Command("delete").description("IP ACL \uADF8\uB8F9\uACFC \uD558\uC704 \uB300\uC0C1\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--yes", "\uC0AD\uC81C\uC640 \uC5F0\uACB0 \uADDC\uCE59 \uC81C\uAC70 \uD655\uC778").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 (groupInput, _opts, cmd) => {
|
|
10940
11100
|
const opts = cmd.optsWithGlobals();
|
|
10941
11101
|
const confirmedYes = requireYes2(opts.yes, "IP ACL \uADF8\uB8F9 \uC0AD\uC81C");
|
|
10942
11102
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
@@ -10968,7 +11128,7 @@ var deleteCommand7 = new import_commander55.Command("delete").description("IP AC
|
|
|
10968
11128
|
ids: [groupId]
|
|
10969
11129
|
});
|
|
10970
11130
|
});
|
|
10971
|
-
var ipaclCommand = new
|
|
11131
|
+
var ipaclCommand = new import_commander57.Command("ipacl").description("IP ACL \uADF8\uB8F9\xB7\uB300\uC0C1 \uC870\uD68C");
|
|
10972
11132
|
ipaclCommand.addCommand(listCommand16);
|
|
10973
11133
|
ipaclCommand.addCommand(getCommand10);
|
|
10974
11134
|
ipaclCommand.addCommand(createCommand9);
|
|
@@ -10984,7 +11144,7 @@ function configureLoadBalancerHelp(command) {
|
|
|
10984
11144
|
}
|
|
10985
11145
|
|
|
10986
11146
|
// src/commands/loadbalancer/binding.ts
|
|
10987
|
-
var
|
|
11147
|
+
var import_commander58 = require("commander");
|
|
10988
11148
|
function bindingResult(operation, loadBalancerId, groupIds) {
|
|
10989
11149
|
return {
|
|
10990
11150
|
operation,
|
|
@@ -11006,7 +11166,7 @@ function outputBindingResult(opts, result) {
|
|
|
11006
11166
|
ids: [result.loadbalancer_id]
|
|
11007
11167
|
});
|
|
11008
11168
|
}
|
|
11009
|
-
var setIpAclCommand2 = new
|
|
11169
|
+
var setIpAclCommand2 = new import_commander58.Command("set-ipacl").description("Load Balancer\uC758 IP ACL \uADF8\uB8F9 \uC5F0\uACB0\uC744 \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").requiredOption(
|
|
11010
11170
|
"--group <group>",
|
|
11011
11171
|
"\uC801\uC6A9\uD560 IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
11012
11172
|
collectOption
|
|
@@ -11046,7 +11206,7 @@ var setIpAclCommand2 = new import_commander56.Command("set-ipacl").description("
|
|
|
11046
11206
|
bindingResult("loadbalancer-set-ipacl", loadBalancerId, groupIds)
|
|
11047
11207
|
);
|
|
11048
11208
|
});
|
|
11049
|
-
var clearIpAclCommand = new
|
|
11209
|
+
var clearIpAclCommand = new import_commander58.Command("clear-ipacl").description("Load Balancer\uC758 \uBAA8\uB4E0 IP ACL \uADF8\uB8F9 \uC5F0\uACB0\uC744 \uD574\uC81C\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").option("--yes", "\uBAA8\uB4E0 IP ACL \uC5F0\uACB0 \uD574\uC81C \uD655\uC778").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 (loadBalancerInput, _opts, cmd) => {
|
|
11050
11210
|
const opts = cmd.optsWithGlobals();
|
|
11051
11211
|
const confirmedYes = requireYes2(opts.yes, "Load Balancer IP ACL \uC5F0\uACB0 \uD574\uC81C");
|
|
11052
11212
|
const parsedLoadBalancer = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
@@ -11071,21 +11231,22 @@ var clearIpAclCommand = new import_commander56.Command("clear-ipacl").descriptio
|
|
|
11071
11231
|
var rootAgentHints = `
|
|
11072
11232
|
Agent hints:
|
|
11073
11233
|
- Prefer --json for structured output.
|
|
11074
|
-
- Use --quiet only when the command documents
|
|
11234
|
+
- Use --quiet only when the command documents a one-line core value.
|
|
11075
11235
|
- Use --profile <name> to avoid relying on default profile.
|
|
11076
11236
|
- For IaaS/NKS commands, use --region <region> when region matters.
|
|
11077
11237
|
- Run "nhncloud commands --json" to inspect command paths and options.
|
|
11078
11238
|
`;
|
|
11079
11239
|
var logncrashAgentWorkflow = `
|
|
11080
11240
|
Agent workflow:
|
|
11081
|
-
1. nhncloud logncrash
|
|
11082
|
-
2. nhncloud logncrash
|
|
11241
|
+
1. nhncloud logncrash available-token --json
|
|
11242
|
+
2. nhncloud logncrash search --query '*' --from 1h --to now --json
|
|
11243
|
+
3. nhncloud logncrash export --query '<lucene>' --from 1h --to now --output logs.jsonl
|
|
11083
11244
|
`;
|
|
11084
11245
|
var deployAgentWorkflow = `
|
|
11085
11246
|
Agent workflow:
|
|
11086
|
-
1. nhncloud deploy artifacts
|
|
11087
|
-
2. nhncloud deploy server-groups <
|
|
11088
|
-
3. nhncloud deploy run <
|
|
11247
|
+
1. nhncloud deploy artifacts --json
|
|
11248
|
+
2. nhncloud deploy server-groups --artifact-id <artifact-id> --json
|
|
11249
|
+
3. nhncloud deploy run --artifact-id <artifact-id> --server-group-id <server-group-id> --scenario-ids <ids>
|
|
11089
11250
|
`;
|
|
11090
11251
|
var instanceAgentWorkflow = `
|
|
11091
11252
|
Agent workflow:
|
|
@@ -11134,8 +11295,8 @@ Agent workflow:
|
|
|
11134
11295
|
2. nhncloud ncs workload list --json
|
|
11135
11296
|
3. nhncloud ncs workload get <id> --json
|
|
11136
11297
|
`;
|
|
11137
|
-
var program = new
|
|
11138
|
-
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.
|
|
11298
|
+
var program = new import_commander59.Command();
|
|
11299
|
+
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.16.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
11300
|
program.hook("preAction", () => {
|
|
11140
11301
|
const opts = program.opts();
|
|
11141
11302
|
const rawTimeout = opts.requestTimeout ?? process.env["NHNCLOUD_REQUEST_TIMEOUT"];
|
|
@@ -11146,7 +11307,7 @@ program.hook("preAction", () => {
|
|
|
11146
11307
|
{ min: 1, max: 3600 }
|
|
11147
11308
|
);
|
|
11148
11309
|
if (!opts.color || process.env["NO_COLOR"]) {
|
|
11149
|
-
|
|
11310
|
+
import_chalk18.default.level = 0;
|
|
11150
11311
|
}
|
|
11151
11312
|
if (opts.json || opts.quiet) {
|
|
11152
11313
|
setQuiet(true);
|
|
@@ -11156,12 +11317,16 @@ program.hook("preAction", () => {
|
|
|
11156
11317
|
}
|
|
11157
11318
|
});
|
|
11158
11319
|
program.addCommand(configureCommand);
|
|
11159
|
-
var logncrashCommand = new
|
|
11320
|
+
var logncrashCommand = new import_commander59.Command("logncrash").description("Log & Crash \uAD00\uB828 \uBA85\uB839").addHelpText("after", logncrashAgentWorkflow);
|
|
11321
|
+
logncrashCommand.addCommand(availableTokenCommand);
|
|
11160
11322
|
logncrashCommand.addCommand(searchCommand);
|
|
11161
11323
|
logncrashCommand.addCommand(sendCommand);
|
|
11162
11324
|
logncrashCommand.addCommand(exportCommand);
|
|
11163
11325
|
program.addCommand(logncrashCommand);
|
|
11164
|
-
var deployCommand2 = new
|
|
11326
|
+
var deployCommand2 = new import_commander59.Command("deploy").description("NHN Cloud Deploy \uAD00\uB828 \uBA85\uB839").addHelpText("after", deployAgentWorkflow);
|
|
11327
|
+
deployCommand2.hook("preSubcommand", async () => {
|
|
11328
|
+
await warnLegacyDeployTargets();
|
|
11329
|
+
});
|
|
11165
11330
|
deployCommand2.addCommand(runCommand);
|
|
11166
11331
|
deployCommand2.addCommand(artifactsCommand);
|
|
11167
11332
|
deployCommand2.addCommand(serverGroupsCommand);
|
|
@@ -11171,7 +11336,7 @@ deployCommand2.addCommand(binariesCommand);
|
|
|
11171
11336
|
deployCommand2.addCommand(uploadCommand);
|
|
11172
11337
|
deployCommand2.addCommand(downloadCommand);
|
|
11173
11338
|
program.addCommand(deployCommand2);
|
|
11174
|
-
var instanceCommand = new
|
|
11339
|
+
var instanceCommand = new import_commander59.Command("instance").description("Compute \uC778\uC2A4\uD134\uC2A4 \uAD00\uB828 \uBA85\uB839").addHelpText("after", instanceAgentWorkflow);
|
|
11175
11340
|
instanceCommand.addCommand(listCommand);
|
|
11176
11341
|
instanceCommand.addCommand(flavorsCommand);
|
|
11177
11342
|
instanceCommand.addCommand(availabilityZonesCommand);
|
|
@@ -11190,23 +11355,23 @@ instanceCommand.addCommand(keypairCommand);
|
|
|
11190
11355
|
instanceCommand.addCommand(volumeCommand);
|
|
11191
11356
|
instanceCommand.addCommand(volumesCommand);
|
|
11192
11357
|
program.addCommand(instanceCommand);
|
|
11193
|
-
var networkCommand = new
|
|
11358
|
+
var networkCommand = new import_commander59.Command("network").description("VPC\xB7\uC11C\uBE0C\uB137 \uC870\uD68C").addHelpText("after", networkAgentWorkflow);
|
|
11194
11359
|
networkCommand.addCommand(listCommand3);
|
|
11195
11360
|
networkCommand.addCommand(subnetCommand);
|
|
11196
11361
|
program.addCommand(networkCommand);
|
|
11197
|
-
var volumeCommand2 = new
|
|
11362
|
+
var volumeCommand2 = new import_commander59.Command("volume").description("Block Storage \uBCFC\uB968 \uAD00\uB828 \uBA85\uB839").addHelpText("after", volumeAgentWorkflow);
|
|
11198
11363
|
volumeCommand2.addCommand(listCommand2);
|
|
11199
11364
|
volumeCommand2.addCommand(getCommand);
|
|
11200
11365
|
volumeCommand2.addCommand(createCommand);
|
|
11201
11366
|
program.addCommand(volumeCommand2);
|
|
11202
|
-
var floatingipCommand = new
|
|
11367
|
+
var floatingipCommand = new import_commander59.Command("floatingip").description(
|
|
11203
11368
|
"Floating IP(\uC778\uC2A4\uD134\uC2A4 \uACF5\uC778 IP) \uAD00\uB9AC"
|
|
11204
11369
|
).addHelpText("after", floatingIpAgentWorkflow);
|
|
11205
11370
|
floatingipCommand.addCommand(listCommand4);
|
|
11206
11371
|
floatingipCommand.addCommand(createCommand2);
|
|
11207
11372
|
floatingipCommand.addCommand(deleteCommand);
|
|
11208
11373
|
program.addCommand(floatingipCommand);
|
|
11209
|
-
var loadbalancerCommand = new
|
|
11374
|
+
var loadbalancerCommand = new import_commander59.Command("loadbalancer").description("Load Balancer\xB7IP ACL \uC870\uD68C\xB7\uAD00\uB9AC").addHelpText("after", loadbalancerAgentWorkflow);
|
|
11210
11375
|
loadbalancerCommand.addCommand(listCommand14);
|
|
11211
11376
|
loadbalancerCommand.addCommand(getCommand9);
|
|
11212
11377
|
loadbalancerCommand.addCommand(ipaclCommand);
|
|
@@ -11214,25 +11379,25 @@ loadbalancerCommand.addCommand(setIpAclCommand2);
|
|
|
11214
11379
|
loadbalancerCommand.addCommand(clearIpAclCommand);
|
|
11215
11380
|
configureLoadBalancerHelp(loadbalancerCommand);
|
|
11216
11381
|
program.addCommand(loadbalancerCommand);
|
|
11217
|
-
var ncrCommand = new
|
|
11382
|
+
var ncrCommand = new import_commander59.Command("ncr").description("NHN Container Registry \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncrAgentWorkflow);
|
|
11218
11383
|
ncrCommand.addCommand(listCommand5);
|
|
11219
11384
|
ncrCommand.addCommand(getCommand3);
|
|
11220
11385
|
ncrCommand.addCommand(imagesCommand2);
|
|
11221
11386
|
ncrCommand.addCommand(tagsCommand);
|
|
11222
11387
|
program.addCommand(ncrCommand);
|
|
11223
|
-
var nksCommand = new
|
|
11388
|
+
var nksCommand = new import_commander59.Command("nks").description("NHN Kubernetes Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", nksAgentWorkflow);
|
|
11224
11389
|
nksCommand.addCommand(supportsCommand);
|
|
11225
11390
|
nksCommand.addCommand(clusterCommand);
|
|
11226
11391
|
nksCommand.addCommand(nodegroupCommand);
|
|
11227
11392
|
nksCommand.addCommand(addonTypeCommand);
|
|
11228
11393
|
nksCommand.addCommand(addonCommand);
|
|
11229
11394
|
program.addCommand(nksCommand);
|
|
11230
|
-
var ncsCommand = new
|
|
11395
|
+
var ncsCommand = new import_commander59.Command("ncs").description("NHN Container Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncsAgentWorkflow);
|
|
11231
11396
|
ncsCommand.addCommand(templateCommand);
|
|
11232
11397
|
ncsCommand.addCommand(workloadCommand);
|
|
11233
11398
|
ncsCommand.addCommand(malwareCommand);
|
|
11234
11399
|
program.addCommand(ncsCommand);
|
|
11235
|
-
var apiGatewayCommand = new
|
|
11400
|
+
var apiGatewayCommand = new import_commander59.Command("apigateway").description("NHN API Gateway \uC870\uD68C \uBA85\uB839");
|
|
11236
11401
|
apiGatewayCommand.addCommand(serviceCommand);
|
|
11237
11402
|
apiGatewayCommand.addCommand(resourceCommand);
|
|
11238
11403
|
apiGatewayCommand.addCommand(stageCommand);
|
|
@@ -11240,11 +11405,15 @@ program.addCommand(apiGatewayCommand);
|
|
|
11240
11405
|
program.addCommand(skillsCommand);
|
|
11241
11406
|
program.addCommand(doctorCommand);
|
|
11242
11407
|
program.addCommand(createCommandsCommand(program));
|
|
11408
|
+
configureCommanderExitCodes(program);
|
|
11243
11409
|
program.parseAsync().catch((err) => {
|
|
11410
|
+
if (err instanceof import_commander59.CommanderError) {
|
|
11411
|
+
process.exit(err.exitCode);
|
|
11412
|
+
}
|
|
11244
11413
|
const message = sanitizeMultilineForTerminal(
|
|
11245
11414
|
err instanceof Error ? err.message : String(err)
|
|
11246
11415
|
);
|
|
11247
11416
|
const exitCode = err instanceof NhnCloudCliError ? err.exitCode : 1;
|
|
11248
|
-
process.stderr.write(
|
|
11417
|
+
process.stderr.write(import_chalk18.default.red(`\uC624\uB958: ${message}`) + "\n");
|
|
11249
11418
|
process.exit(exitCode);
|
|
11250
11419
|
});
|