@bifos/nhncloud-cli 0.8.0 → 0.9.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 +23 -0
- package/dist/index.js +480 -277
- package/package.json +1 -1
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_commander48 = 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"));
|
|
@@ -587,9 +587,9 @@ function isKeystoneTokenResponse(val) {
|
|
|
587
587
|
if (typeof val !== "object" || val === null) return false;
|
|
588
588
|
const obj = val;
|
|
589
589
|
if (typeof obj["access"] !== "object" || obj["access"] === null) return false;
|
|
590
|
-
const
|
|
591
|
-
if (typeof
|
|
592
|
-
const token =
|
|
590
|
+
const access4 = obj["access"];
|
|
591
|
+
if (typeof access4["token"] !== "object" || access4["token"] === null) return false;
|
|
592
|
+
const token = access4["token"];
|
|
593
593
|
return typeof token["id"] === "string" && typeof token["expires"] === "string";
|
|
594
594
|
}
|
|
595
595
|
async function getIaasToken(profile, iaas, forceRefresh = false) {
|
|
@@ -1149,8 +1149,209 @@ var configureCommand = new import_commander.Command("configure").description("\u
|
|
|
1149
1149
|
}
|
|
1150
1150
|
});
|
|
1151
1151
|
|
|
1152
|
-
// src/commands/
|
|
1152
|
+
// src/commands/skills.ts
|
|
1153
1153
|
var import_commander2 = require("commander");
|
|
1154
|
+
var import_chalk2 = __toESM(require("chalk"));
|
|
1155
|
+
var import_promises4 = require("fs/promises");
|
|
1156
|
+
|
|
1157
|
+
// src/utils/skill-install.ts
|
|
1158
|
+
var import_node_os3 = require("os");
|
|
1159
|
+
var import_node_path3 = __toESM(require("path"));
|
|
1160
|
+
var import_promises3 = require("fs/promises");
|
|
1161
|
+
var SKILL_NAME = "nhncloud-cli";
|
|
1162
|
+
function claudeDir() {
|
|
1163
|
+
return import_node_path3.default.join((0, import_node_os3.homedir)(), ".claude");
|
|
1164
|
+
}
|
|
1165
|
+
function skillDestPath() {
|
|
1166
|
+
return import_node_path3.default.join(claudeDir(), "skills", SKILL_NAME);
|
|
1167
|
+
}
|
|
1168
|
+
function skillSourceFrom(bundleDir) {
|
|
1169
|
+
return import_node_path3.default.resolve(bundleDir, "..", "skills", SKILL_NAME);
|
|
1170
|
+
}
|
|
1171
|
+
function isNpxRuntime(bundleDir) {
|
|
1172
|
+
return /_npx[/\\]/.test(bundleDir) || /\.npm[/\\]_npx/.test(bundleDir) || /npx-/.test(bundleDir);
|
|
1173
|
+
}
|
|
1174
|
+
async function getSkillStatus(dst) {
|
|
1175
|
+
let stat;
|
|
1176
|
+
try {
|
|
1177
|
+
stat = await (0, import_promises3.lstat)(dst);
|
|
1178
|
+
} catch {
|
|
1179
|
+
return { state: "not-installed" };
|
|
1180
|
+
}
|
|
1181
|
+
if (!stat.isSymbolicLink()) {
|
|
1182
|
+
return { state: "installed-copy" };
|
|
1183
|
+
}
|
|
1184
|
+
const raw = await (0, import_promises3.readlink)(dst);
|
|
1185
|
+
const target = import_node_path3.default.isAbsolute(raw) ? raw : import_node_path3.default.resolve(import_node_path3.default.dirname(dst), raw);
|
|
1186
|
+
const targetExists = await (0, import_promises3.access)(target).then(() => true).catch(() => false);
|
|
1187
|
+
return targetExists ? { state: "installed-link", target } : { state: "broken-link", target };
|
|
1188
|
+
}
|
|
1189
|
+
async function installSkillSymlink(src, dst, force) {
|
|
1190
|
+
const srcExists = await (0, import_promises3.access)(src).then(() => true).catch(() => false);
|
|
1191
|
+
if (!srcExists) {
|
|
1192
|
+
throw new NhnCloudCliError(`skill \uC6D0\uBCF8\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${src}`, EXIT_PARAM_ERROR);
|
|
1193
|
+
}
|
|
1194
|
+
const status = await getSkillStatus(dst);
|
|
1195
|
+
if (status.state === "installed-copy" && !force) {
|
|
1196
|
+
throw new NhnCloudCliError(
|
|
1197
|
+
`${dst} \uC5D0 \uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uAC00 \uC544\uB2CC \uC2E4\uC81C \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4. --force \uB85C \uB36E\uC5B4\uC4F0\uC138\uC694.`,
|
|
1198
|
+
EXIT_PARAM_ERROR
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
let result = "linked";
|
|
1202
|
+
if (status.state === "installed-copy") {
|
|
1203
|
+
await (0, import_promises3.rm)(dst, { recursive: true, force: true });
|
|
1204
|
+
result = "replaced-copy";
|
|
1205
|
+
} else if (status.state !== "not-installed") {
|
|
1206
|
+
await (0, import_promises3.rm)(dst, { force: true });
|
|
1207
|
+
result = "relinked";
|
|
1208
|
+
}
|
|
1209
|
+
await (0, import_promises3.mkdir)(import_node_path3.default.dirname(dst), { recursive: true });
|
|
1210
|
+
await (0, import_promises3.symlink)(src, dst);
|
|
1211
|
+
return result;
|
|
1212
|
+
}
|
|
1213
|
+
async function uninstallSkill(dst) {
|
|
1214
|
+
const status = await getSkillStatus(dst);
|
|
1215
|
+
if (status.state === "not-installed") {
|
|
1216
|
+
return "absent";
|
|
1217
|
+
}
|
|
1218
|
+
if (status.state === "installed-copy") {
|
|
1219
|
+
throw new NhnCloudCliError(
|
|
1220
|
+
`${dst} \uB294 \uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uAC00 \uC544\uB2C8\uB77C \uC2E4\uC81C \uB514\uB809\uD130\uB9AC\uC785\uB2C8\uB2E4. \uC9C1\uC811 \uD655\uC778 \uD6C4 \uC81C\uAC70\uD558\uC138\uC694.`,
|
|
1221
|
+
EXIT_PARAM_ERROR
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
await (0, import_promises3.rm)(dst, { force: true });
|
|
1225
|
+
return "removed";
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
// src/commands/skills.ts
|
|
1229
|
+
function describeStatus(status) {
|
|
1230
|
+
switch (status.state) {
|
|
1231
|
+
case "installed-link":
|
|
1232
|
+
return import_chalk2.default.green(`\u2713 \uC124\uCE58\uB428 (\uC2EC\uBCFC\uB9AD \uB9C1\uD06C \u2192 ${status.target})`);
|
|
1233
|
+
case "broken-link":
|
|
1234
|
+
return import_chalk2.default.yellow(`\u26A0 \uB9C1\uD06C \uAE68\uC9D0 (${status.target} \uC5C6\uC74C) \u2014 skills install \uB85C \uC7AC\uC124\uCE58`);
|
|
1235
|
+
case "installed-copy":
|
|
1236
|
+
return import_chalk2.default.green("\u2713 \uC124\uCE58\uB428 (\uC2E4\uC81C \uBCF5\uC0AC\uBCF8)");
|
|
1237
|
+
case "not-installed":
|
|
1238
|
+
return import_chalk2.default.gray("\uBBF8\uC124\uCE58 \u2014 nhncloud skills install \uB85C \uC124\uCE58");
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
var installCommand = new import_commander2.Command("install").description("Claude Code \uC2A4\uD0AC\uC744 ~/.claude/skills \uC5D0 \uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uB85C \uC124\uCE58\uD55C\uB2E4").option("--force", "\uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uAC00 \uC544\uB2CC \uAE30\uC874 \uD56D\uBAA9\uB3C4 \uB36E\uC5B4\uC4F4\uB2E4").action(async (opts) => {
|
|
1242
|
+
const hasClaude = await (0, import_promises4.access)(claudeDir()).then(() => true).catch(() => false);
|
|
1243
|
+
if (!hasClaude) {
|
|
1244
|
+
throw new NhnCloudCliError(
|
|
1245
|
+
`Claude Code \uC124\uC815 \uB514\uB809\uD130\uB9AC(${claudeDir()})\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. Claude Code \uC124\uCE58 \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC138\uC694.`,
|
|
1246
|
+
EXIT_PARAM_ERROR
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
if (isNpxRuntime(__dirname)) {
|
|
1250
|
+
throw new NhnCloudCliError(
|
|
1251
|
+
"npx \uD658\uACBD\uC5D0\uC11C\uB294 \uC2A4\uD0AC \uC124\uCE58\uAC00 \uBD88\uAC00\uD569\uB2C8\uB2E4(\uC784\uC2DC \uACBD\uB85C). npm i -g @bifos/nhncloud-cli \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC138\uC694.",
|
|
1252
|
+
EXIT_PARAM_ERROR
|
|
1253
|
+
);
|
|
1254
|
+
}
|
|
1255
|
+
const src = skillSourceFrom(__dirname);
|
|
1256
|
+
const dst = skillDestPath();
|
|
1257
|
+
const result = await installSkillSymlink(src, dst, opts.force ?? false);
|
|
1258
|
+
if (result === "replaced-copy") {
|
|
1259
|
+
console.error(import_chalk2.default.yellow(`\uAE30\uC874 \uC2E4\uC81C \uB514\uB809\uD130\uB9AC\uB97C \uC81C\uAC70\uD558\uACE0 \uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uB85C \uAD50\uCCB4\uD588\uC2B5\uB2C8\uB2E4: ${dst}`));
|
|
1260
|
+
}
|
|
1261
|
+
console.log(import_chalk2.default.green(`\u2713 \uC2A4\uD0AC ${result === "linked" ? "\uC124\uCE58" : "\uC7AC\uC124\uCE58"} \uC644\uB8CC: ${dst}`));
|
|
1262
|
+
});
|
|
1263
|
+
var uninstallCommand = new import_commander2.Command("uninstall").description("\uC124\uCE58\uB41C Claude Code \uC2A4\uD0AC \uC2EC\uBCFC\uB9AD \uB9C1\uD06C\uB97C \uC81C\uAC70\uD55C\uB2E4").action(async () => {
|
|
1264
|
+
const dst = skillDestPath();
|
|
1265
|
+
const result = await uninstallSkill(dst);
|
|
1266
|
+
if (result === "absent") {
|
|
1267
|
+
console.log(import_chalk2.default.gray("\uC124\uCE58\uB41C \uC2A4\uD0AC\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."));
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
console.log(import_chalk2.default.green(`\u2713 \uC2A4\uD0AC \uC81C\uAC70 \uC644\uB8CC: ${dst}`));
|
|
1271
|
+
});
|
|
1272
|
+
var skillsCommand = new import_commander2.Command("skills").description(`Claude Code \uC2A4\uD0AC(${SKILL_NAME}) \uC124\uCE58 \uAD00\uB9AC`).addCommand(installCommand).addCommand(uninstallCommand).action(async () => {
|
|
1273
|
+
const status = await getSkillStatus(skillDestPath());
|
|
1274
|
+
console.log(`Claude Code \uC2A4\uD0AC (${SKILL_NAME}): ${describeStatus(status)}`);
|
|
1275
|
+
});
|
|
1276
|
+
|
|
1277
|
+
// src/commands/doctor.ts
|
|
1278
|
+
var import_commander3 = require("commander");
|
|
1279
|
+
var import_chalk3 = __toESM(require("chalk"));
|
|
1280
|
+
var import_promises5 = require("fs/promises");
|
|
1281
|
+
var import_node_os4 = require("os");
|
|
1282
|
+
var import_node_path4 = __toESM(require("path"));
|
|
1283
|
+
var CREDENTIALS_PATH2 = import_node_path4.default.join((0, import_node_os4.homedir)(), ".nhncloud", "credentials.json");
|
|
1284
|
+
var CONFIG_PATH2 = import_node_path4.default.join((0, import_node_os4.homedir)(), ".nhncloud", "config.json");
|
|
1285
|
+
async function readProfiles() {
|
|
1286
|
+
let raw;
|
|
1287
|
+
try {
|
|
1288
|
+
raw = await (0, import_promises5.readFile)(CREDENTIALS_PATH2, "utf-8");
|
|
1289
|
+
} catch {
|
|
1290
|
+
return { profiles: [], parseError: false, missing: true };
|
|
1291
|
+
}
|
|
1292
|
+
try {
|
|
1293
|
+
const parsed = JSON.parse(raw);
|
|
1294
|
+
return { profiles: Object.keys(parsed.profiles ?? {}), parseError: false, missing: false };
|
|
1295
|
+
} catch {
|
|
1296
|
+
return { profiles: [], parseError: true, missing: false };
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
async function readDefaultProfile() {
|
|
1300
|
+
try {
|
|
1301
|
+
const raw = await (0, import_promises5.readFile)(CONFIG_PATH2, "utf-8");
|
|
1302
|
+
const parsed = JSON.parse(raw);
|
|
1303
|
+
return parsed.defaultProfile ?? null;
|
|
1304
|
+
} catch {
|
|
1305
|
+
return null;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
var doctorCommand = new import_commander3.Command("doctor").description("\uC790\uACA9\uC99D\uBA85\xB7\uC2A4\uD0AC \uC124\uCE58 \uC0C1\uD0DC\uB97C \uC9C4\uB2E8\uD55C\uB2E4(\uC624\uD504\uB77C\uC778 \u2014 \uC5F0\uACB0 \uD14C\uC2A4\uD2B8\uB294 configure \uB85C)").action(async () => {
|
|
1309
|
+
console.log(import_chalk3.default.bold("\n\u{1F50D} nhncloud-cli \uC9C4\uB2E8\n"));
|
|
1310
|
+
const creds = await readProfiles();
|
|
1311
|
+
const defaultProfile = await readDefaultProfile();
|
|
1312
|
+
console.log(import_chalk3.default.bold("\uC790\uACA9\uC99D\uBA85"));
|
|
1313
|
+
if (creds.missing) {
|
|
1314
|
+
console.log(` ${import_chalk3.default.red("\u274C \uBBF8\uC124\uC815")} \u2014 ${CREDENTIALS_PATH2} \uC5C6\uC74C. nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
1315
|
+
} else if (creds.parseError) {
|
|
1316
|
+
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.`);
|
|
1317
|
+
} else if (creds.profiles.length === 0) {
|
|
1318
|
+
console.log(` ${import_chalk3.default.yellow("\u26A0 profile \uC5C6\uC74C")} \u2014 nhncloud configure \uB85C \uC124\uC815\uD558\uC138\uC694.`);
|
|
1319
|
+
} else {
|
|
1320
|
+
console.log(` ${import_chalk3.default.green("\u2713 \uC124\uC815\uB428")} \u2014 profile: ${creds.profiles.join(", ")}`);
|
|
1321
|
+
console.log(` \uAE30\uBCF8 profile: ${defaultProfile ? import_chalk3.default.green(defaultProfile) : import_chalk3.default.gray("\uBBF8\uC9C0\uC815 (default \uC0AC\uC6A9)")}`);
|
|
1322
|
+
}
|
|
1323
|
+
console.log(import_chalk3.default.bold("\nClaude Code \uC2A4\uD0AC"));
|
|
1324
|
+
const hasClaude = await (0, import_promises5.access)(claudeDir()).then(() => true).catch(() => false);
|
|
1325
|
+
if (!hasClaude) {
|
|
1326
|
+
console.log(` ${import_chalk3.default.gray("Claude Code \uBBF8\uC124\uCE58")} \u2014 ${claudeDir()} \uC5C6\uC74C`);
|
|
1327
|
+
} else {
|
|
1328
|
+
const status = await getSkillStatus(skillDestPath());
|
|
1329
|
+
switch (status.state) {
|
|
1330
|
+
case "installed-link":
|
|
1331
|
+
console.log(` ${SKILL_NAME}: ${import_chalk3.default.green("\u2713 \uC124\uCE58\uB428 (\uC2EC\uBCFC\uB9AD \uB9C1\uD06C)")}`);
|
|
1332
|
+
break;
|
|
1333
|
+
case "broken-link":
|
|
1334
|
+
console.log(` ${SKILL_NAME}: ${import_chalk3.default.yellow("\u26A0 \uB9C1\uD06C \uAE68\uC9D0 \u2014 nhncloud skills install \uB85C \uC7AC\uC124\uCE58")}`);
|
|
1335
|
+
break;
|
|
1336
|
+
case "installed-copy":
|
|
1337
|
+
console.log(` ${SKILL_NAME}: ${import_chalk3.default.green("\u2713 \uC124\uCE58\uB428 (\uC2E4\uC81C \uBCF5\uC0AC\uBCF8)")}`);
|
|
1338
|
+
break;
|
|
1339
|
+
case "not-installed":
|
|
1340
|
+
console.log(` ${SKILL_NAME}: ${import_chalk3.default.gray("\uBBF8\uC124\uCE58 \u2014 nhncloud skills install \uB85C \uC124\uCE58")}`);
|
|
1341
|
+
break;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
console.log();
|
|
1345
|
+
if (!creds.missing && !creds.parseError && creds.profiles.length > 0) {
|
|
1346
|
+
console.log(import_chalk3.default.green("\u2713 \uAE30\uBCF8 \uC124\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
1347
|
+
} else {
|
|
1348
|
+
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4: nhncloud configure"));
|
|
1349
|
+
}
|
|
1350
|
+
console.log();
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
// src/commands/logncrash/search.ts
|
|
1354
|
+
var import_commander4 = require("commander");
|
|
1154
1355
|
|
|
1155
1356
|
// src/utils/time.ts
|
|
1156
1357
|
function toLocalISOString(date) {
|
|
@@ -1296,7 +1497,7 @@ function formatLogRow(log) {
|
|
|
1296
1497
|
const body = truncate(getString(log["logBody"] ?? log["body"] ?? log["message"] ?? ""), 60);
|
|
1297
1498
|
return [logTime, logType, body];
|
|
1298
1499
|
}
|
|
1299
|
-
var searchCommand = new
|
|
1500
|
+
var searchCommand = new import_commander4.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: ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (1h/30m/2d/now) (\uD544\uC218)").option("--to <time>", "\uAC80\uC0C9 \uB05D: ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (\uD544\uC218)").option("--page <n>", "pageNumber (\uAE30\uBCF8 0)", "0").option("--size <n>", "pageSize (\uAE30\uBCF8 10, \uCD5C\uB300 100)", "10").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
1300
1501
|
const opts = cmd.optsWithGlobals();
|
|
1301
1502
|
if (!opts.query) {
|
|
1302
1503
|
throw new NhnCloudCliError(`--query \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --query 'logType:"NORMAL"'`, EXIT_PARAM_ERROR);
|
|
@@ -1360,7 +1561,7 @@ credentials.json \uC5D0 "secret": "<secretkey>" \uB97C \uCD94\uAC00\uD558\uC138\
|
|
|
1360
1561
|
});
|
|
1361
1562
|
|
|
1362
1563
|
// src/commands/logncrash/send.ts
|
|
1363
|
-
var
|
|
1564
|
+
var import_commander5 = require("commander");
|
|
1364
1565
|
var import_node_fs = require("fs");
|
|
1365
1566
|
var MAX_LOG_BYTES = 8 * 1024 * 1024;
|
|
1366
1567
|
var VALID_LEVELS = ["DEBUG", "INFO", "WARN", "ERROR", "FATAL"];
|
|
@@ -1393,7 +1594,7 @@ function resolveBody(opts) {
|
|
|
1393
1594
|
EXIT_PARAM_ERROR
|
|
1394
1595
|
);
|
|
1395
1596
|
}
|
|
1396
|
-
var sendCommand = new
|
|
1597
|
+
var sendCommand = new import_commander5.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) => {
|
|
1397
1598
|
const opts = cmd.optsWithGlobals();
|
|
1398
1599
|
const body = resolveBody(opts);
|
|
1399
1600
|
const bytes = Buffer.byteLength(body, "utf-8");
|
|
@@ -1448,26 +1649,26 @@ credentials.json \uC5D0 "appkey": "<appkey>" \uB97C \uCD94\uAC00\uD558\uC138\uC6
|
|
|
1448
1649
|
});
|
|
1449
1650
|
|
|
1450
1651
|
// src/commands/logncrash/export.ts
|
|
1451
|
-
var
|
|
1452
|
-
var
|
|
1652
|
+
var import_commander6 = require("commander");
|
|
1653
|
+
var import_promises6 = require("fs/promises");
|
|
1453
1654
|
var import_node_fs2 = require("fs");
|
|
1454
1655
|
var import_node_crypto2 = require("crypto");
|
|
1455
1656
|
var MAX_TOTAL = 1e5;
|
|
1456
|
-
function assertWritable(
|
|
1657
|
+
function assertWritable(path3, force) {
|
|
1457
1658
|
if (force) return;
|
|
1458
1659
|
try {
|
|
1459
|
-
(0, import_node_fs2.statSync)(
|
|
1660
|
+
(0, import_node_fs2.statSync)(path3);
|
|
1460
1661
|
} catch (e) {
|
|
1461
1662
|
if (e.code === "ENOENT") return;
|
|
1462
1663
|
const reason = e.code ?? (e instanceof Error ? e.message : String(e));
|
|
1463
|
-
throw new NhnCloudCliError(`--output \uACBD\uB85C\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${
|
|
1664
|
+
throw new NhnCloudCliError(`--output \uACBD\uB85C\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${path3} (${reason})`, EXIT_PARAM_ERROR);
|
|
1464
1665
|
}
|
|
1465
1666
|
throw new NhnCloudCliError(
|
|
1466
|
-
`--output \uB300\uC0C1\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${
|
|
1667
|
+
`--output \uB300\uC0C1\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${path3}. \uB36E\uC5B4\uC4F0\uB824\uBA74 --force \uB97C \uC4F0\uC138\uC694.`,
|
|
1467
1668
|
EXIT_PARAM_ERROR
|
|
1468
1669
|
);
|
|
1469
1670
|
}
|
|
1470
|
-
var exportCommand = new
|
|
1671
|
+
var exportCommand = new import_commander6.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: ISO8601 \uB610\uB294 \uC0C1\uB300\uC2DC\uAC04 (1h/30m/2d/now) (\uD544\uC218)").option("--to <time>", "\uAC80\uC0C9 \uB05D: 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>", "scroll \uD398\uC774\uC9C0 \uD06C\uAE30 (docs \uBC94\uC704 10~100, \uAE30\uBCF8 100)", "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) => {
|
|
1471
1672
|
const opts = cmd.optsWithGlobals();
|
|
1472
1673
|
if (!opts.query) {
|
|
1473
1674
|
throw new NhnCloudCliError(`--query \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4. \uC608: --query 'logType:"NORMAL"'`, EXIT_PARAM_ERROR);
|
|
@@ -1548,15 +1749,15 @@ credentials.json \uC5D0 "secret": "<secret>" \uB97C \uCD94\uAC00\uD558\uC138\uC6
|
|
|
1548
1749
|
} catch (err) {
|
|
1549
1750
|
stopSpinner(false);
|
|
1550
1751
|
stream.destroy();
|
|
1551
|
-
await (0,
|
|
1752
|
+
await (0, import_promises6.rm)(tmp, { force: true }).catch(() => {
|
|
1552
1753
|
});
|
|
1553
1754
|
throw err;
|
|
1554
1755
|
}
|
|
1555
1756
|
stopSpinner(true, `${count}\uAC74 \uCD94\uCD9C \uC644\uB8CC`);
|
|
1556
1757
|
try {
|
|
1557
|
-
await (0,
|
|
1758
|
+
await (0, import_promises6.rename)(tmp, opts.output);
|
|
1558
1759
|
} catch (err) {
|
|
1559
|
-
await (0,
|
|
1760
|
+
await (0, import_promises6.rm)(tmp, { force: true }).catch(() => {
|
|
1560
1761
|
});
|
|
1561
1762
|
const reason = err.code ?? (err instanceof Error ? err.message : String(err));
|
|
1562
1763
|
throw new NhnCloudCliError(`\uCD9C\uB825 \uD30C\uC77C\uC744 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${opts.output} (${reason})`, EXIT_PARAM_ERROR);
|
|
@@ -1585,7 +1786,7 @@ async function scrollNextOrExpire(client, scrollKey) {
|
|
|
1585
1786
|
}
|
|
1586
1787
|
|
|
1587
1788
|
// src/commands/deploy/run.ts
|
|
1588
|
-
var
|
|
1789
|
+
var import_commander7 = require("commander");
|
|
1589
1790
|
|
|
1590
1791
|
// src/services/deploy/client.ts
|
|
1591
1792
|
var import_ky6 = __toESM(require("ky"));
|
|
@@ -1834,7 +2035,7 @@ async function createDeployClient(profileOpt) {
|
|
|
1834
2035
|
}
|
|
1835
2036
|
|
|
1836
2037
|
// src/commands/deploy/run.ts
|
|
1837
|
-
var runCommand = new
|
|
2038
|
+
var runCommand = new import_commander7.Command("run").description("\uBC30\uD3EC\uB97C \uC2E4\uD589\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").option("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--server-group-id <id>", "target \uC758 serverGroupId override").option("--scenario-ids <csv>", "target \uC758 scenarioIds override").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 (targetName, _opts, cmd) => {
|
|
1838
2039
|
const opts = cmd.optsWithGlobals();
|
|
1839
2040
|
const concurrentNum = parsePositiveIntegerOption(opts.concurrent ?? "1", "--concurrent");
|
|
1840
2041
|
const target = await getDeployTarget(targetName);
|
|
@@ -1871,8 +2072,8 @@ var runCommand = new import_commander5.Command("run").description("\uBC30\uD3EC\
|
|
|
1871
2072
|
});
|
|
1872
2073
|
|
|
1873
2074
|
// src/commands/deploy/artifacts.ts
|
|
1874
|
-
var
|
|
1875
|
-
var artifactsCommand = new
|
|
2075
|
+
var import_commander8 = require("commander");
|
|
2076
|
+
var artifactsCommand = new import_commander8.Command("artifacts").description("\uC544\uD2F0\uD329\uD2B8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("[target]", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984 (--app-key \uB85C \uB300\uCCB4 \uAC00\uB2A5)").option("--app-key <k>", "appKey \uC9C1\uC811 \uC9C0\uC815 (target \uC5C6\uC774 \uC0AC\uC6A9 \uAC00\uB2A5)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
1876
2077
|
const opts = cmd.optsWithGlobals();
|
|
1877
2078
|
let appKey;
|
|
1878
2079
|
if (opts.appKey) {
|
|
@@ -1912,8 +2113,8 @@ var artifactsCommand = new import_commander6.Command("artifacts").description("\
|
|
|
1912
2113
|
});
|
|
1913
2114
|
|
|
1914
2115
|
// src/commands/deploy/server-groups.ts
|
|
1915
|
-
var
|
|
1916
|
-
var serverGroupsCommand = new
|
|
2116
|
+
var import_commander9 = require("commander");
|
|
2117
|
+
var serverGroupsCommand = new import_commander9.Command("server-groups").description("\uC11C\uBC84\uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").option("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
1917
2118
|
const opts = cmd.optsWithGlobals();
|
|
1918
2119
|
const target = await getDeployTarget(targetName);
|
|
1919
2120
|
const appKey = opts.appKey ?? target.appKey;
|
|
@@ -1937,8 +2138,8 @@ var serverGroupsCommand = new import_commander7.Command("server-groups").descrip
|
|
|
1937
2138
|
});
|
|
1938
2139
|
|
|
1939
2140
|
// src/commands/deploy/histories.ts
|
|
1940
|
-
var
|
|
1941
|
-
var historiesCommand = new
|
|
2141
|
+
var import_commander10 = require("commander");
|
|
2142
|
+
var historiesCommand = new import_commander10.Command("histories").description("\uBC30\uD3EC \uC774\uB825\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").option("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
1942
2143
|
const opts = cmd.optsWithGlobals();
|
|
1943
2144
|
const target = await getDeployTarget(targetName);
|
|
1944
2145
|
const appKey = opts.appKey ?? target.appKey;
|
|
@@ -1962,8 +2163,8 @@ var historiesCommand = new import_commander8.Command("histories").description("\
|
|
|
1962
2163
|
});
|
|
1963
2164
|
|
|
1964
2165
|
// src/commands/deploy/binary-groups.ts
|
|
1965
|
-
var
|
|
1966
|
-
var binaryGroupsCommand = new
|
|
2166
|
+
var import_commander11 = require("commander");
|
|
2167
|
+
var binaryGroupsCommand = new import_commander11.Command("binary-groups").description("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").option("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
1967
2168
|
const opts = cmd.optsWithGlobals();
|
|
1968
2169
|
const target = await getDeployTarget(targetName);
|
|
1969
2170
|
const appKey = opts.appKey ?? target.appKey;
|
|
@@ -1995,7 +2196,7 @@ var binaryGroupsCommand = new import_commander9.Command("binary-groups").descrip
|
|
|
1995
2196
|
});
|
|
1996
2197
|
|
|
1997
2198
|
// src/commands/deploy/binaries.ts
|
|
1998
|
-
var
|
|
2199
|
+
var import_commander12 = require("commander");
|
|
1999
2200
|
function parsePositiveInt(value, flag) {
|
|
2000
2201
|
if (value === void 0) return void 0;
|
|
2001
2202
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -2006,7 +2207,7 @@ function parsePositiveInt(value, flag) {
|
|
|
2006
2207
|
}
|
|
2007
2208
|
return Number(value);
|
|
2008
2209
|
}
|
|
2009
|
-
var binariesCommand = new
|
|
2210
|
+
var binariesCommand = new import_commander12.Command("binaries").description("\uD2B9\uC815 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC758 \uBC14\uC774\uB108\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").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("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
2010
2211
|
const opts = cmd.optsWithGlobals();
|
|
2011
2212
|
const binaryGroupKey = parsePositiveInt(opts.binaryGroup, "--binary-group");
|
|
2012
2213
|
if (binaryGroupKey === void 0) {
|
|
@@ -2051,9 +2252,9 @@ var binariesCommand = new import_commander10.Command("binaries").description("\u
|
|
|
2051
2252
|
});
|
|
2052
2253
|
|
|
2053
2254
|
// src/commands/deploy/upload.ts
|
|
2054
|
-
var
|
|
2255
|
+
var import_commander13 = require("commander");
|
|
2055
2256
|
var import_node_fs3 = require("fs");
|
|
2056
|
-
var
|
|
2257
|
+
var import_node_path5 = require("path");
|
|
2057
2258
|
var MAX_UPLOAD_BYTES = 512 * 1024 * 1024;
|
|
2058
2259
|
function parsePositiveInt2(value, flag) {
|
|
2059
2260
|
if (value === void 0) return void 0;
|
|
@@ -2065,7 +2266,7 @@ function parsePositiveInt2(value, flag) {
|
|
|
2065
2266
|
}
|
|
2066
2267
|
return Number(value);
|
|
2067
2268
|
}
|
|
2068
|
-
var uploadCommand = new
|
|
2269
|
+
var uploadCommand = new import_commander13.Command("upload").description("\uB85C\uCEEC \uD30C\uC77C\uC744 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC5D0 \uC5C5\uB85C\uB4DC\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").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("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
2069
2270
|
const opts = cmd.optsWithGlobals();
|
|
2070
2271
|
const binaryGroupKey = parsePositiveInt2(opts.binaryGroup, "--binary-group");
|
|
2071
2272
|
if (binaryGroupKey === void 0) {
|
|
@@ -2092,7 +2293,7 @@ var uploadCommand = new import_commander11.Command("upload").description("\uB85C
|
|
|
2092
2293
|
);
|
|
2093
2294
|
}
|
|
2094
2295
|
const fileBuffer = (0, import_node_fs3.readFileSync)(filePath);
|
|
2095
|
-
const fileName = (0,
|
|
2296
|
+
const fileName = (0, import_node_path5.basename)(filePath);
|
|
2096
2297
|
const target = await getDeployTarget(targetName);
|
|
2097
2298
|
const appKey = opts.appKey ?? target.appKey;
|
|
2098
2299
|
const artifactId = opts.artifactId ?? target.artifactId;
|
|
@@ -2127,9 +2328,9 @@ var uploadCommand = new import_commander11.Command("upload").description("\uB85C
|
|
|
2127
2328
|
});
|
|
2128
2329
|
|
|
2129
2330
|
// src/commands/deploy/download.ts
|
|
2130
|
-
var
|
|
2331
|
+
var import_commander14 = require("commander");
|
|
2131
2332
|
var import_node_fs4 = require("fs");
|
|
2132
|
-
var
|
|
2333
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
2133
2334
|
function parsePositiveInt3(value, flag) {
|
|
2134
2335
|
if (value === void 0) return void 0;
|
|
2135
2336
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -2140,24 +2341,24 @@ function parsePositiveInt3(value, flag) {
|
|
|
2140
2341
|
}
|
|
2141
2342
|
return Number(value);
|
|
2142
2343
|
}
|
|
2143
|
-
function assertWritable2(
|
|
2344
|
+
function assertWritable2(path3, force) {
|
|
2144
2345
|
if (force) return;
|
|
2145
2346
|
try {
|
|
2146
|
-
(0, import_node_fs4.statSync)(
|
|
2347
|
+
(0, import_node_fs4.statSync)(path3);
|
|
2147
2348
|
} catch (e) {
|
|
2148
2349
|
if (e.code === "ENOENT") return;
|
|
2149
2350
|
const reason = e.code ?? (e instanceof Error ? e.message : String(e));
|
|
2150
2351
|
throw new NhnCloudCliError(
|
|
2151
|
-
`-o \uACBD\uB85C\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${
|
|
2352
|
+
`-o \uACBD\uB85C\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${path3} (${reason})`,
|
|
2152
2353
|
EXIT_PARAM_ERROR
|
|
2153
2354
|
);
|
|
2154
2355
|
}
|
|
2155
2356
|
throw new NhnCloudCliError(
|
|
2156
|
-
`-o \uB300\uC0C1\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${
|
|
2357
|
+
`-o \uB300\uC0C1\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${path3}. \uB36E\uC5B4\uC4F0\uB824\uBA74 --force \uB97C \uC4F0\uC138\uC694.`,
|
|
2157
2358
|
EXIT_PARAM_ERROR
|
|
2158
2359
|
);
|
|
2159
2360
|
}
|
|
2160
|
-
var downloadCommand = new
|
|
2361
|
+
var downloadCommand = new import_commander14.Command("download").description("\uBC14\uC774\uB108\uB9AC\uB97C \uB85C\uCEEC \uD30C\uC77C\uB85C \uB2E4\uC6B4\uB85C\uB4DC\uD55C\uB2E4").argument("<target>", "config.json \uC5D0 \uC815\uC758\uB41C deploy target \uC774\uB984").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("--app-key <k>", "target \uC758 appKey override").option("--artifact-id <id>", "target \uC758 artifactId override").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetName, _opts, cmd) => {
|
|
2161
2362
|
const opts = cmd.optsWithGlobals();
|
|
2162
2363
|
const binaryGroupKey = parsePositiveInt3(opts.binaryGroup, "--binary-group");
|
|
2163
2364
|
const binaryKey = parsePositiveInt3(opts.binaryKey, "--binary-key");
|
|
@@ -2180,13 +2381,13 @@ var downloadCommand = new import_commander12.Command("download").description("\u
|
|
|
2180
2381
|
}
|
|
2181
2382
|
stopSpinner(true);
|
|
2182
2383
|
if (!opts.quiet) {
|
|
2183
|
-
process.stderr.write(
|
|
2384
|
+
process.stderr.write(import_chalk4.default.green(` \uC800\uC7A5\uB428: ${outPath}
|
|
2184
2385
|
`));
|
|
2185
2386
|
}
|
|
2186
2387
|
});
|
|
2187
2388
|
|
|
2188
2389
|
// src/commands/instance/list.ts
|
|
2189
|
-
var
|
|
2390
|
+
var import_commander15 = require("commander");
|
|
2190
2391
|
|
|
2191
2392
|
// src/commands/iaas.ts
|
|
2192
2393
|
async function resolveIaasTokenContext(opts) {
|
|
@@ -2489,8 +2690,8 @@ var InstanceClient = class {
|
|
|
2489
2690
|
return this.serverAction(id, { revertResize: null });
|
|
2490
2691
|
}
|
|
2491
2692
|
async listFlavors(params = {}) {
|
|
2492
|
-
const
|
|
2493
|
-
const url = `${this.computeEndpoint}${
|
|
2693
|
+
const path3 = params.detail ? "/flavors/detail" : "/flavors";
|
|
2694
|
+
const url = `${this.computeEndpoint}${path3}`;
|
|
2494
2695
|
const searchParams = {};
|
|
2495
2696
|
if (params.minDisk !== void 0) searchParams["minDisk"] = params.minDisk;
|
|
2496
2697
|
if (params.minRam !== void 0) searchParams["minRam"] = params.minRam;
|
|
@@ -2752,7 +2953,7 @@ async function resolveInstanceClient(opts) {
|
|
|
2752
2953
|
function getIps(server) {
|
|
2753
2954
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
2754
2955
|
}
|
|
2755
|
-
var listCommand = new
|
|
2956
|
+
var listCommand = new import_commander15.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) => {
|
|
2756
2957
|
const opts = cmd.optsWithGlobals();
|
|
2757
2958
|
const { client } = await resolveInstanceClient(opts);
|
|
2758
2959
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -2773,7 +2974,7 @@ var listCommand = new import_commander13.Command("list").description("\uC778\uC2
|
|
|
2773
2974
|
});
|
|
2774
2975
|
|
|
2775
2976
|
// src/commands/volume/list.ts
|
|
2776
|
-
var
|
|
2977
|
+
var import_commander16 = require("commander");
|
|
2777
2978
|
|
|
2778
2979
|
// src/services/blockstorage/client.ts
|
|
2779
2980
|
var import_ky8 = __toESM(require("ky"));
|
|
@@ -2884,7 +3085,7 @@ function parsePositiveInt4(value, flag) {
|
|
|
2884
3085
|
}
|
|
2885
3086
|
return Number(value);
|
|
2886
3087
|
}
|
|
2887
|
-
var listCommand2 = new
|
|
3088
|
+
var listCommand2 = new import_commander16.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) => {
|
|
2888
3089
|
const opts = cmd.optsWithGlobals();
|
|
2889
3090
|
const limitNum = opts.limit !== void 0 ? parsePositiveInt4(opts.limit, "--limit") : void 0;
|
|
2890
3091
|
const offsetNum = opts.offset !== void 0 ? parsePositiveInt4(opts.offset, "--offset") : void 0;
|
|
@@ -2918,8 +3119,8 @@ var listCommand2 = new import_commander14.Command("list").description("\uBCFC\uB
|
|
|
2918
3119
|
});
|
|
2919
3120
|
|
|
2920
3121
|
// src/commands/volume/get.ts
|
|
2921
|
-
var
|
|
2922
|
-
var getCommand = new
|
|
3122
|
+
var import_commander17 = require("commander");
|
|
3123
|
+
var getCommand = new import_commander17.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) => {
|
|
2923
3124
|
const opts = cmd.optsWithGlobals();
|
|
2924
3125
|
const { client } = await resolveVolumeClient(opts);
|
|
2925
3126
|
startSpinner("\uBCFC\uB968 \uC870\uD68C \uC911...");
|
|
@@ -2950,9 +3151,9 @@ var getCommand = new import_commander15.Command("get").description("\uB2E8\uC77C
|
|
|
2950
3151
|
});
|
|
2951
3152
|
|
|
2952
3153
|
// src/commands/volume/create.ts
|
|
2953
|
-
var
|
|
2954
|
-
var
|
|
2955
|
-
var createCommand = new
|
|
3154
|
+
var import_commander18 = require("commander");
|
|
3155
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
3156
|
+
var createCommand = new import_commander18.Command("create").description("\uBCFC\uB968\uC744 \uBC1C\uAE09\uD55C\uB2E4").requiredOption("--size <gb>", "\uBCFC\uB968 \uD06C\uAE30(GB) \u2014 \uD544\uC218").option("--name <name>", "\uBCFC\uB968 \uC774\uB984").option("--description <text>", "\uBCFC\uB968 \uC124\uBA85").option("--volume-type <type>", "\uBCFC\uB968 \uD0C0\uC785").option("--availability-zone <az>", "\uAC00\uC6A9\uC131 \uC601\uC5ED(AZ). instance availability-zones \uB85C \uC870\uD68C\uD55C zoneName \uC9C0\uC815").option("--snapshot-id <id>", "\uC2A4\uB0C5\uC0F7 ID (\uC2A4\uB0C5\uC0F7\uC5D0\uC11C \uBCFC\uB968 \uC0DD\uC131)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
2956
3157
|
const opts = cmd.optsWithGlobals();
|
|
2957
3158
|
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
2958
3159
|
throw new NhnCloudCliError(
|
|
@@ -2985,7 +3186,7 @@ var createCommand = new import_commander16.Command("create").description("\uBCFC
|
|
|
2985
3186
|
throw err;
|
|
2986
3187
|
}
|
|
2987
3188
|
stopSpinner(true);
|
|
2988
|
-
process.stderr.write(
|
|
3189
|
+
process.stderr.write(import_chalk5.default.green(`\uBCFC\uB968 \uBC1C\uAE09 \uC694\uCCAD \uC644\uB8CC (id: ${volume.id}, status: ${volume.status})
|
|
2989
3190
|
`));
|
|
2990
3191
|
const rows = [
|
|
2991
3192
|
["id", volume.id],
|
|
@@ -3005,7 +3206,7 @@ var createCommand = new import_commander16.Command("create").description("\uBCFC
|
|
|
3005
3206
|
});
|
|
3006
3207
|
|
|
3007
3208
|
// src/commands/network/list.ts
|
|
3008
|
-
var
|
|
3209
|
+
var import_commander19 = require("commander");
|
|
3009
3210
|
|
|
3010
3211
|
// src/services/network/client.ts
|
|
3011
3212
|
var import_ky9 = __toESM(require("ky"));
|
|
@@ -3185,7 +3386,7 @@ async function resolveNetworkClient(opts) {
|
|
|
3185
3386
|
}
|
|
3186
3387
|
|
|
3187
3388
|
// src/commands/network/list.ts
|
|
3188
|
-
var listCommand3 = new
|
|
3389
|
+
var listCommand3 = new import_commander19.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) => {
|
|
3189
3390
|
const opts = cmd.optsWithGlobals();
|
|
3190
3391
|
const { client } = await resolveNetworkClient(opts);
|
|
3191
3392
|
startSpinner("VPC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3206,8 +3407,8 @@ var listCommand3 = new import_commander17.Command("list").description("VPC \uBAA
|
|
|
3206
3407
|
});
|
|
3207
3408
|
|
|
3208
3409
|
// src/commands/network/subnet.ts
|
|
3209
|
-
var
|
|
3210
|
-
var subnetListCommand = new
|
|
3410
|
+
var import_commander20 = require("commander");
|
|
3411
|
+
var subnetListCommand = new import_commander20.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) => {
|
|
3211
3412
|
const opts = cmd.optsWithGlobals();
|
|
3212
3413
|
const { client } = await resolveNetworkClient(opts);
|
|
3213
3414
|
startSpinner("\uC11C\uBE0C\uB137 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3232,11 +3433,11 @@ var subnetListCommand = new import_commander18.Command("list").description("\uC1
|
|
|
3232
3433
|
ids: subnets.map((s) => s.id)
|
|
3233
3434
|
});
|
|
3234
3435
|
});
|
|
3235
|
-
var subnetCommand = new
|
|
3436
|
+
var subnetCommand = new import_commander20.Command("subnet").description("\uC11C\uBE0C\uB137 \uAD00\uB828 \uBA85\uB839").addCommand(subnetListCommand);
|
|
3236
3437
|
|
|
3237
3438
|
// src/commands/floatingip/list.ts
|
|
3238
|
-
var
|
|
3239
|
-
var listCommand4 = new
|
|
3439
|
+
var import_commander21 = require("commander");
|
|
3440
|
+
var listCommand4 = new import_commander21.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) => {
|
|
3240
3441
|
const opts = cmd.optsWithGlobals();
|
|
3241
3442
|
const { client } = await resolveNetworkClient(opts);
|
|
3242
3443
|
startSpinner("Floating IP \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3263,9 +3464,9 @@ var listCommand4 = new import_commander19.Command("list").description("Floating
|
|
|
3263
3464
|
});
|
|
3264
3465
|
|
|
3265
3466
|
// src/commands/floatingip/create.ts
|
|
3266
|
-
var
|
|
3267
|
-
var
|
|
3268
|
-
var createCommand2 = new
|
|
3467
|
+
var import_commander22 = require("commander");
|
|
3468
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
3469
|
+
var createCommand2 = new import_commander22.Command("create").description("Floating IP \uB97C \uBC1C\uAE09\uD55C\uB2E4 (--network \uBBF8\uC9C0\uC815 \uC2DC \uC678\uBD80 VPC \uC790\uB3D9 \uC870\uD68C)").option("--network <id>", "\uC678\uBD80 \uB124\uD2B8\uC6CC\uD06C(VPC) id (\uBBF8\uC9C0\uC815 \uC2DC router:external=true \uC790\uB3D9 \uC870\uD68C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
3269
3470
|
const opts = cmd.optsWithGlobals();
|
|
3270
3471
|
const { client } = await resolveNetworkClient(opts);
|
|
3271
3472
|
let networkId = opts.network;
|
|
@@ -3296,7 +3497,7 @@ var createCommand2 = new import_commander20.Command("create").description("Float
|
|
|
3296
3497
|
}
|
|
3297
3498
|
stopSpinner(true);
|
|
3298
3499
|
process.stderr.write(
|
|
3299
|
-
|
|
3500
|
+
import_chalk6.default.green(`\u2713 Floating IP "${fip.floating_ip_address}" \uB97C \uBC1C\uAE09\uD588\uC2B5\uB2C8\uB2E4 (id: ${fip.id}).
|
|
3300
3501
|
`)
|
|
3301
3502
|
);
|
|
3302
3503
|
output(opts, {
|
|
@@ -3308,9 +3509,9 @@ var createCommand2 = new import_commander20.Command("create").description("Float
|
|
|
3308
3509
|
});
|
|
3309
3510
|
|
|
3310
3511
|
// src/commands/floatingip/delete.ts
|
|
3311
|
-
var
|
|
3312
|
-
var
|
|
3313
|
-
var deleteCommand = new
|
|
3512
|
+
var import_commander23 = require("commander");
|
|
3513
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
3514
|
+
var deleteCommand = new import_commander23.Command("delete").description("Floating IP \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "Floating IP ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3314
3515
|
const opts = cmd.optsWithGlobals();
|
|
3315
3516
|
const isTTY = process.stdin.isTTY;
|
|
3316
3517
|
if (!isTTY && !opts.yes) {
|
|
@@ -3326,7 +3527,7 @@ var deleteCommand = new import_commander21.Command("delete").description("Floati
|
|
|
3326
3527
|
default: false
|
|
3327
3528
|
});
|
|
3328
3529
|
if (!ok) {
|
|
3329
|
-
process.stderr.write(
|
|
3530
|
+
process.stderr.write(import_chalk7.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
3330
3531
|
return;
|
|
3331
3532
|
}
|
|
3332
3533
|
}
|
|
@@ -3339,13 +3540,13 @@ var deleteCommand = new import_commander21.Command("delete").description("Floati
|
|
|
3339
3540
|
throw err;
|
|
3340
3541
|
}
|
|
3341
3542
|
stopSpinner(true);
|
|
3342
|
-
process.stderr.write(
|
|
3543
|
+
process.stderr.write(import_chalk7.default.green(`\u2713 Floating IP "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
3343
3544
|
`));
|
|
3344
3545
|
});
|
|
3345
3546
|
|
|
3346
3547
|
// src/commands/instance/flavors.ts
|
|
3347
|
-
var
|
|
3348
|
-
var flavorsCommand = new
|
|
3548
|
+
var import_commander24 = require("commander");
|
|
3549
|
+
var flavorsCommand = new import_commander24.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) => {
|
|
3349
3550
|
const opts = cmd.optsWithGlobals();
|
|
3350
3551
|
const minDisk = parseNonNegativeIntegerOption(opts.minDisk, "--min-disk");
|
|
3351
3552
|
const minRam = parseNonNegativeIntegerOption(opts.minRam, "--min-ram");
|
|
@@ -3388,8 +3589,8 @@ function isDetailList(flavors) {
|
|
|
3388
3589
|
}
|
|
3389
3590
|
|
|
3390
3591
|
// src/commands/instance/availability-zones.ts
|
|
3391
|
-
var
|
|
3392
|
-
var availabilityZonesCommand = new
|
|
3592
|
+
var import_commander25 = require("commander");
|
|
3593
|
+
var availabilityZonesCommand = new import_commander25.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) => {
|
|
3393
3594
|
const opts = cmd.optsWithGlobals();
|
|
3394
3595
|
const { client } = await resolveInstanceClient(opts);
|
|
3395
3596
|
startSpinner("\uAC00\uC6A9\uC131 \uC601\uC5ED \uC870\uD68C \uC911...");
|
|
@@ -3410,14 +3611,14 @@ var availabilityZonesCommand = new import_commander23.Command("availability-zone
|
|
|
3410
3611
|
});
|
|
3411
3612
|
|
|
3412
3613
|
// src/commands/instance/get.ts
|
|
3413
|
-
var
|
|
3614
|
+
var import_commander26 = require("commander");
|
|
3414
3615
|
function getIps2(server) {
|
|
3415
3616
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
3416
3617
|
}
|
|
3417
3618
|
function getImageId(server) {
|
|
3418
3619
|
return typeof server.image === "object" ? server.image.id : "";
|
|
3419
3620
|
}
|
|
3420
|
-
var getCommand2 = new
|
|
3621
|
+
var getCommand2 = new import_commander26.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) => {
|
|
3421
3622
|
const opts = cmd.optsWithGlobals();
|
|
3422
3623
|
const { client } = await resolveInstanceClient(opts);
|
|
3423
3624
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uC870\uD68C \uC911...");
|
|
@@ -3449,9 +3650,9 @@ var getCommand2 = new import_commander24.Command("get").description("\uB2E8\uC77
|
|
|
3449
3650
|
});
|
|
3450
3651
|
|
|
3451
3652
|
// src/commands/instance/create.ts
|
|
3452
|
-
var
|
|
3653
|
+
var import_commander27 = require("commander");
|
|
3453
3654
|
var import_node_fs5 = require("fs");
|
|
3454
|
-
var
|
|
3655
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
3455
3656
|
function getFirstIp(server) {
|
|
3456
3657
|
for (const list of Object.values(server.addresses)) {
|
|
3457
3658
|
for (const addr of list) {
|
|
@@ -3466,7 +3667,7 @@ function getIps3(server) {
|
|
|
3466
3667
|
function getImageId2(server) {
|
|
3467
3668
|
return typeof server.image === "object" ? server.image.id : "";
|
|
3468
3669
|
}
|
|
3469
|
-
var createCommand3 = new
|
|
3670
|
+
var createCommand3 = new import_commander27.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) => {
|
|
3470
3671
|
const opts = cmd.optsWithGlobals();
|
|
3471
3672
|
const networks = opts.network ?? [];
|
|
3472
3673
|
if (networks.length === 0) {
|
|
@@ -3545,7 +3746,7 @@ var createCommand3 = new import_commander25.Command("create").description("\uC77
|
|
|
3545
3746
|
return;
|
|
3546
3747
|
}
|
|
3547
3748
|
if (opts.wait) {
|
|
3548
|
-
process.stderr.write(
|
|
3749
|
+
process.stderr.write(import_chalk8.default.green(` IP: ${getIps3(server)}
|
|
3549
3750
|
`));
|
|
3550
3751
|
}
|
|
3551
3752
|
const rows = [
|
|
@@ -3565,9 +3766,9 @@ var createCommand3 = new import_commander25.Command("create").description("\uC77
|
|
|
3565
3766
|
});
|
|
3566
3767
|
|
|
3567
3768
|
// src/commands/instance/delete.ts
|
|
3568
|
-
var
|
|
3569
|
-
var
|
|
3570
|
-
var deleteCommand2 = new
|
|
3769
|
+
var import_commander28 = require("commander");
|
|
3770
|
+
var import_chalk9 = __toESM(require("chalk"));
|
|
3771
|
+
var deleteCommand2 = new import_commander28.Command("delete").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3571
3772
|
const opts = cmd.optsWithGlobals();
|
|
3572
3773
|
const isTTY = process.stdin.isTTY;
|
|
3573
3774
|
if (!isTTY && !opts.yes) {
|
|
@@ -3583,7 +3784,7 @@ var deleteCommand2 = new import_commander26.Command("delete").description("\uC77
|
|
|
3583
3784
|
default: false
|
|
3584
3785
|
});
|
|
3585
3786
|
if (!ok) {
|
|
3586
|
-
process.stderr.write(
|
|
3787
|
+
process.stderr.write(import_chalk9.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
3587
3788
|
return;
|
|
3588
3789
|
}
|
|
3589
3790
|
}
|
|
@@ -3596,14 +3797,14 @@ var deleteCommand2 = new import_commander26.Command("delete").description("\uC77
|
|
|
3596
3797
|
throw err;
|
|
3597
3798
|
}
|
|
3598
3799
|
stopSpinner(true);
|
|
3599
|
-
process.stderr.write(
|
|
3800
|
+
process.stderr.write(import_chalk9.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
3600
3801
|
`));
|
|
3601
3802
|
});
|
|
3602
3803
|
|
|
3603
3804
|
// src/commands/instance/power.ts
|
|
3604
|
-
var
|
|
3605
|
-
var
|
|
3606
|
-
var startCommand = new
|
|
3805
|
+
var import_commander29 = require("commander");
|
|
3806
|
+
var import_chalk10 = __toESM(require("chalk"));
|
|
3807
|
+
var startCommand = new import_commander29.Command("start").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC2DC\uC791\uD55C\uB2E4 (SHUTOFF \u2192 ACTIVE)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3607
3808
|
const opts = cmd.optsWithGlobals();
|
|
3608
3809
|
const { client } = await resolveInstanceClient(opts);
|
|
3609
3810
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC2DC\uC791 \uC911... (id: ${id})`);
|
|
@@ -3614,10 +3815,10 @@ var startCommand = new import_commander27.Command("start").description("\uC778\u
|
|
|
3614
3815
|
throw err;
|
|
3615
3816
|
}
|
|
3616
3817
|
stopSpinner(true);
|
|
3617
|
-
process.stderr.write(
|
|
3818
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC2DC\uC791\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 ACTIVE).
|
|
3618
3819
|
`));
|
|
3619
3820
|
});
|
|
3620
|
-
var stopCommand = new
|
|
3821
|
+
var stopCommand = new import_commander29.Command("stop").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC815\uC9C0\uD55C\uB2E4 (ACTIVE/ERROR \u2192 SHUTOFF)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3621
3822
|
const opts = cmd.optsWithGlobals();
|
|
3622
3823
|
const { client } = await resolveInstanceClient(opts);
|
|
3623
3824
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC815\uC9C0 \uC911... (id: ${id})`);
|
|
@@ -3628,10 +3829,10 @@ var stopCommand = new import_commander27.Command("stop").description("\uC778\uC2
|
|
|
3628
3829
|
throw err;
|
|
3629
3830
|
}
|
|
3630
3831
|
stopSpinner(true);
|
|
3631
|
-
process.stderr.write(
|
|
3832
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC815\uC9C0\uB97C \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 SHUTOFF).
|
|
3632
3833
|
`));
|
|
3633
3834
|
});
|
|
3634
|
-
var rebootCommand = new
|
|
3835
|
+
var rebootCommand = new import_commander29.Command("reboot").description("\uC778\uC2A4\uD134\uC2A4\uB97C \uC7AC\uBD80\uD305\uD55C\uB2E4 (\uAE30\uBCF8 SOFT, --hard \uB85C HARD)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--hard", "HARD \uC7AC\uBD80\uD305 (\uAC15\uC81C \uC804\uC6D0 cycle, \uAE30\uBCF8\uC740 SOFT)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3635
3836
|
const opts = cmd.optsWithGlobals();
|
|
3636
3837
|
const { client } = await resolveInstanceClient(opts);
|
|
3637
3838
|
const type = opts.hard ? "HARD" : "SOFT";
|
|
@@ -3643,14 +3844,14 @@ var rebootCommand = new import_commander27.Command("reboot").description("\uC778
|
|
|
3643
3844
|
throw err;
|
|
3644
3845
|
}
|
|
3645
3846
|
stopSpinner(true);
|
|
3646
|
-
process.stderr.write(
|
|
3847
|
+
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" ${type} \uC7AC\uBD80\uD305\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4.
|
|
3647
3848
|
`));
|
|
3648
3849
|
});
|
|
3649
3850
|
|
|
3650
3851
|
// src/commands/instance/resize.ts
|
|
3651
|
-
var
|
|
3652
|
-
var
|
|
3653
|
-
var resizeCommand = new
|
|
3852
|
+
var import_commander30 = require("commander");
|
|
3853
|
+
var import_chalk11 = __toESM(require("chalk"));
|
|
3854
|
+
var resizeCommand = new import_commander30.Command("resize").description("\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785(flavor)\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").requiredOption("--flavor <id>", "\uBCC0\uACBD\uD560 flavor ID (instance flavors \uB85C \uD6C4\uBCF4 \uC870\uD68C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3654
3855
|
const opts = cmd.optsWithGlobals();
|
|
3655
3856
|
const { client } = await resolveInstanceClient(opts);
|
|
3656
3857
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785 \uBCC0\uACBD \uC911... (id: ${id})`);
|
|
@@ -3662,13 +3863,13 @@ var resizeCommand = new import_commander28.Command("resize").description("\uC778
|
|
|
3662
3863
|
}
|
|
3663
3864
|
stopSpinner(true);
|
|
3664
3865
|
process.stderr.write(
|
|
3665
|
-
|
|
3866
|
+
import_chalk11.default.green(
|
|
3666
3867
|
`\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).
|
|
3667
3868
|
`
|
|
3668
3869
|
)
|
|
3669
3870
|
);
|
|
3670
3871
|
});
|
|
3671
|
-
var resizeConfirmCommand = new
|
|
3872
|
+
var resizeConfirmCommand = new import_commander30.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) => {
|
|
3672
3873
|
const opts = cmd.optsWithGlobals();
|
|
3673
3874
|
const { client } = await resolveInstanceClient(opts);
|
|
3674
3875
|
startSpinner(`resize \uD655\uC815 \uC911... (id: ${id})`);
|
|
@@ -3679,10 +3880,10 @@ var resizeConfirmCommand = new import_commander28.Command("resize-confirm").desc
|
|
|
3679
3880
|
throw err;
|
|
3680
3881
|
}
|
|
3681
3882
|
stopSpinner(true);
|
|
3682
|
-
process.stderr.write(
|
|
3883
|
+
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).
|
|
3683
3884
|
`));
|
|
3684
3885
|
});
|
|
3685
|
-
var resizeRevertCommand = new
|
|
3886
|
+
var resizeRevertCommand = new import_commander30.Command("resize-revert").description("resize \uB97C \uB864\uBC31\uD55C\uB2E4 (VERIFY_RESIZE \u2192 ACTIVE, \uC774\uC804 flavor \uB85C \uBCF5\uADC0)").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3686
3887
|
const opts = cmd.optsWithGlobals();
|
|
3687
3888
|
const { client } = await resolveInstanceClient(opts);
|
|
3688
3889
|
startSpinner(`resize \uB864\uBC31 \uC911... (id: ${id})`);
|
|
@@ -3694,15 +3895,15 @@ var resizeRevertCommand = new import_commander28.Command("resize-revert").descri
|
|
|
3694
3895
|
}
|
|
3695
3896
|
stopSpinner(true);
|
|
3696
3897
|
process.stderr.write(
|
|
3697
|
-
|
|
3898
|
+
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).
|
|
3698
3899
|
`)
|
|
3699
3900
|
);
|
|
3700
3901
|
});
|
|
3701
3902
|
|
|
3702
3903
|
// src/commands/instance/images.ts
|
|
3703
|
-
var
|
|
3904
|
+
var import_commander31 = require("commander");
|
|
3704
3905
|
var VISIBILITY_VALUES = ["public", "private", "shared"];
|
|
3705
|
-
var imagesCommand = new
|
|
3906
|
+
var imagesCommand = new import_commander31.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) => {
|
|
3706
3907
|
const opts = cmd.optsWithGlobals();
|
|
3707
3908
|
const limit = parsePositiveIntegerOption(opts.limit, "--limit");
|
|
3708
3909
|
if (opts.visibility !== void 0 && !VISIBILITY_VALUES.includes(opts.visibility)) {
|
|
@@ -3750,8 +3951,8 @@ var imagesCommand = new import_commander29.Command("images").description("\uC774
|
|
|
3750
3951
|
});
|
|
3751
3952
|
|
|
3752
3953
|
// src/commands/instance/keypairs.ts
|
|
3753
|
-
var
|
|
3754
|
-
var keypairsCommand = new
|
|
3954
|
+
var import_commander32 = require("commander");
|
|
3955
|
+
var keypairsCommand = new import_commander32.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) => {
|
|
3755
3956
|
const opts = cmd.optsWithGlobals();
|
|
3756
3957
|
const { client } = await resolveInstanceClient(opts);
|
|
3757
3958
|
startSpinner("\uD0A4\uD398\uC5B4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3772,10 +3973,10 @@ var keypairsCommand = new import_commander30.Command("keypairs").description("\u
|
|
|
3772
3973
|
});
|
|
3773
3974
|
|
|
3774
3975
|
// src/commands/instance/keypair.ts
|
|
3775
|
-
var
|
|
3976
|
+
var import_commander33 = require("commander");
|
|
3776
3977
|
var import_node_fs6 = require("fs");
|
|
3777
3978
|
var import_node_crypto3 = require("crypto");
|
|
3778
|
-
var
|
|
3979
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
3779
3980
|
function resolvePublicKey(value) {
|
|
3780
3981
|
let stat;
|
|
3781
3982
|
try {
|
|
@@ -3815,7 +4016,7 @@ function savePrivateKey(filePath, privateKey) {
|
|
|
3815
4016
|
);
|
|
3816
4017
|
}
|
|
3817
4018
|
}
|
|
3818
|
-
var getKeypairCmd = new
|
|
4019
|
+
var getKeypairCmd = new import_commander33.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) => {
|
|
3819
4020
|
const opts = cmd.optsWithGlobals();
|
|
3820
4021
|
const { client } = await resolveInstanceClient(opts);
|
|
3821
4022
|
startSpinner("\uD0A4\uD398\uC5B4 \uC870\uD68C \uC911...");
|
|
@@ -3840,7 +4041,7 @@ var getKeypairCmd = new import_commander31.Command("get").description("\uB2E8\uC
|
|
|
3840
4041
|
ids: [kp.name]
|
|
3841
4042
|
});
|
|
3842
4043
|
});
|
|
3843
|
-
var createKeypairCmd = new
|
|
4044
|
+
var createKeypairCmd = new import_commander33.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) => {
|
|
3844
4045
|
const opts = cmd.optsWithGlobals();
|
|
3845
4046
|
const publicKey = opts.publicKey !== void 0 ? resolvePublicKey(opts.publicKey) : void 0;
|
|
3846
4047
|
if (opts.output !== void 0 && publicKey !== void 0) {
|
|
@@ -3869,19 +4070,19 @@ var createKeypairCmd = new import_commander31.Command("create").description("\uD
|
|
|
3869
4070
|
if (opts.output !== void 0) {
|
|
3870
4071
|
try {
|
|
3871
4072
|
savePrivateKey(opts.output, result.private_key);
|
|
3872
|
-
process.stderr.write(
|
|
4073
|
+
process.stderr.write(import_chalk12.default.green(` private_key \uB97C ${opts.output} \uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4 (mode 0600).
|
|
3873
4074
|
`));
|
|
3874
4075
|
} catch (saveErr) {
|
|
3875
4076
|
const reason = saveErr instanceof Error ? saveErr.message : String(saveErr);
|
|
3876
4077
|
process.stderr.write(
|
|
3877
|
-
|
|
4078
|
+
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.
|
|
3878
4079
|
`)
|
|
3879
4080
|
);
|
|
3880
4081
|
process.stdout.write(result.private_key + "\n");
|
|
3881
4082
|
}
|
|
3882
4083
|
} else {
|
|
3883
4084
|
process.stderr.write(
|
|
3884
|
-
|
|
4085
|
+
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")
|
|
3885
4086
|
);
|
|
3886
4087
|
process.stdout.write(result.private_key + "\n");
|
|
3887
4088
|
}
|
|
@@ -3899,7 +4100,7 @@ var createKeypairCmd = new import_commander31.Command("create").description("\uD
|
|
|
3899
4100
|
ids: [meta.name]
|
|
3900
4101
|
});
|
|
3901
4102
|
});
|
|
3902
|
-
var deleteKeypairCmd = new
|
|
4103
|
+
var deleteKeypairCmd = new import_commander33.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) => {
|
|
3903
4104
|
const opts = cmd.optsWithGlobals();
|
|
3904
4105
|
const { client } = await resolveInstanceClient(opts);
|
|
3905
4106
|
startSpinner("\uD0A4\uD398\uC5B4 \uC0AD\uC81C \uC911...");
|
|
@@ -3910,15 +4111,15 @@ var deleteKeypairCmd = new import_commander31.Command("delete").description("\uD
|
|
|
3910
4111
|
throw err;
|
|
3911
4112
|
}
|
|
3912
4113
|
stopSpinner(true);
|
|
3913
|
-
process.stderr.write(
|
|
4114
|
+
process.stderr.write(import_chalk12.default.green(`\u2713 \uD0A4\uD398\uC5B4 "${name}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
3914
4115
|
`));
|
|
3915
4116
|
});
|
|
3916
|
-
var keypairCommand = new
|
|
4117
|
+
var keypairCommand = new import_commander33.Command("keypair").description("\uD0A4\uD398\uC5B4 \uB2E8\uAC74 \uAD00\uB9AC (get / create / delete)").addCommand(getKeypairCmd).addCommand(createKeypairCmd).addCommand(deleteKeypairCmd);
|
|
3917
4118
|
|
|
3918
4119
|
// src/commands/instance/volume.ts
|
|
3919
|
-
var
|
|
3920
|
-
var
|
|
3921
|
-
var attachCommand = new
|
|
4120
|
+
var import_commander34 = require("commander");
|
|
4121
|
+
var import_chalk13 = __toESM(require("chalk"));
|
|
4122
|
+
var attachCommand = new import_commander34.Command("attach").description("\uBCFC\uB968\uC744 \uC778\uC2A4\uD134\uC2A4\uC5D0 \uC5F0\uACB0\uD55C\uB2E4").argument("<id>", "\uC778\uC2A4\uD134\uC2A4 ID").requiredOption("--volume <volumeId>", "\uC5F0\uACB0\uD560 \uBCFC\uB968 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
3922
4123
|
const opts = cmd.optsWithGlobals();
|
|
3923
4124
|
const { client } = await resolveInstanceClient(opts);
|
|
3924
4125
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uC911...");
|
|
@@ -3931,7 +4132,7 @@ var attachCommand = new import_commander32.Command("attach").description("\uBCFC
|
|
|
3931
4132
|
}
|
|
3932
4133
|
stopSpinner(true);
|
|
3933
4134
|
process.stderr.write(
|
|
3934
|
-
|
|
4135
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uC644\uB8CC (volumeId: ${att.volumeId}, device: ${att.device})
|
|
3935
4136
|
`)
|
|
3936
4137
|
);
|
|
3937
4138
|
output(opts, {
|
|
@@ -3946,7 +4147,7 @@ var attachCommand = new import_commander32.Command("attach").description("\uBCFC
|
|
|
3946
4147
|
ids: [att.id]
|
|
3947
4148
|
});
|
|
3948
4149
|
});
|
|
3949
|
-
var detachCommand = new
|
|
4150
|
+
var detachCommand = new import_commander34.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) => {
|
|
3950
4151
|
const opts = cmd.optsWithGlobals();
|
|
3951
4152
|
const { client } = await resolveInstanceClient(opts);
|
|
3952
4153
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -3958,19 +4159,19 @@ var detachCommand = new import_commander32.Command("detach").description("\uBCFC
|
|
|
3958
4159
|
}
|
|
3959
4160
|
stopSpinner(true);
|
|
3960
4161
|
process.stderr.write(
|
|
3961
|
-
|
|
4162
|
+
import_chalk13.default.green(`\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC694\uCCAD \uC644\uB8CC (volumeId: ${volumeId})
|
|
3962
4163
|
`)
|
|
3963
4164
|
);
|
|
3964
4165
|
});
|
|
3965
|
-
var volumeCommand = new
|
|
4166
|
+
var volumeCommand = new import_commander34.Command("volume").description(
|
|
3966
4167
|
"\uC778\uC2A4\uD134\uC2A4 \uBCFC\uB968 \uC5F0\uACB0/\uD574\uC81C"
|
|
3967
4168
|
);
|
|
3968
4169
|
volumeCommand.addCommand(attachCommand);
|
|
3969
4170
|
volumeCommand.addCommand(detachCommand);
|
|
3970
4171
|
|
|
3971
4172
|
// src/commands/instance/volumes.ts
|
|
3972
|
-
var
|
|
3973
|
-
var volumesCommand = new
|
|
4173
|
+
var import_commander35 = require("commander");
|
|
4174
|
+
var volumesCommand = new import_commander35.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) => {
|
|
3974
4175
|
const opts = cmd.optsWithGlobals();
|
|
3975
4176
|
const { client } = await resolveInstanceClient(opts);
|
|
3976
4177
|
startSpinner("\uBCFC\uB968 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3991,7 +4192,7 @@ var volumesCommand = new import_commander33.Command("volumes").description("\uC7
|
|
|
3991
4192
|
});
|
|
3992
4193
|
|
|
3993
4194
|
// src/commands/ncr/list.ts
|
|
3994
|
-
var
|
|
4195
|
+
var import_commander36 = require("commander");
|
|
3995
4196
|
|
|
3996
4197
|
// src/services/ncr/harbor-client.ts
|
|
3997
4198
|
var import_ky10 = __toESM(require("ky"));
|
|
@@ -4018,12 +4219,12 @@ var HarborClient = class {
|
|
|
4018
4219
|
* ky.get() 이 Response 를 반환하므로 .json() 과 .headers.get("link") 를 함께 사용한다
|
|
4019
4220
|
* (체이닝하면 헤더를 못 본다 — 기존 NCR client 의 .json<T>() 체이닝 패턴과 다름).
|
|
4020
4221
|
*/
|
|
4021
|
-
async getAllPages(
|
|
4222
|
+
async getAllPages(path3) {
|
|
4022
4223
|
const acc = [];
|
|
4023
4224
|
let page = 1;
|
|
4024
4225
|
try {
|
|
4025
4226
|
for (; ; ) {
|
|
4026
|
-
const url = `https://${this.host}${
|
|
4227
|
+
const url = `https://${this.host}${path3}?page=${page}&page_size=${PAGE_SIZE}`;
|
|
4027
4228
|
const res = await import_ky10.default.get(url, {
|
|
4028
4229
|
headers: this.basicAuthHeaders(),
|
|
4029
4230
|
retry: 0,
|
|
@@ -4130,7 +4331,7 @@ function parseHarborHost(uri) {
|
|
|
4130
4331
|
}
|
|
4131
4332
|
|
|
4132
4333
|
// src/commands/ncr/list.ts
|
|
4133
|
-
var listCommand5 = new
|
|
4334
|
+
var listCommand5 = new import_commander36.Command("list").description("NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--app-key <key>", "NCR appKey (profile \uC758 ncr.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4134
4335
|
const opts = cmd.optsWithGlobals();
|
|
4135
4336
|
const { client, profileName } = await createNcrClient(opts);
|
|
4136
4337
|
const appKey = await resolveAppKey(profileName, opts.appKey);
|
|
@@ -4156,8 +4357,8 @@ var listCommand5 = new import_commander34.Command("list").description("NCR \uB80
|
|
|
4156
4357
|
});
|
|
4157
4358
|
|
|
4158
4359
|
// src/commands/ncr/get.ts
|
|
4159
|
-
var
|
|
4160
|
-
var getCommand3 = new
|
|
4360
|
+
var import_commander37 = require("commander");
|
|
4361
|
+
var getCommand3 = new import_commander37.Command("get").description("\uB2E8\uC77C NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984 \uB610\uB294 ID").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--app-key <key>", "NCR appKey (profile \uC758 ncr.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
4161
4362
|
const opts = cmd.optsWithGlobals();
|
|
4162
4363
|
if (!registry.trim()) {
|
|
4163
4364
|
throw new NhnCloudCliError(
|
|
@@ -4185,8 +4386,8 @@ var getCommand3 = new import_commander35.Command("get").description("\uB2E8\uC77
|
|
|
4185
4386
|
});
|
|
4186
4387
|
|
|
4187
4388
|
// src/commands/ncr/images.ts
|
|
4188
|
-
var
|
|
4189
|
-
var imagesCommand2 = new
|
|
4389
|
+
var import_commander38 = require("commander");
|
|
4390
|
+
var imagesCommand2 = new import_commander38.Command("images").description("\uB808\uC9C0\uC2A4\uD2B8\uB9AC\uC758 \uC774\uBBF8\uC9C0(repository) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--app-key <key>", "NCR appKey (profile \uC758 ncr.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
4190
4391
|
const opts = cmd.optsWithGlobals();
|
|
4191
4392
|
if (!registry.trim()) {
|
|
4192
4393
|
throw new NhnCloudCliError(
|
|
@@ -4220,8 +4421,8 @@ var imagesCommand2 = new import_commander36.Command("images").description("\uB80
|
|
|
4220
4421
|
});
|
|
4221
4422
|
|
|
4222
4423
|
// src/commands/ncr/tags.ts
|
|
4223
|
-
var
|
|
4224
|
-
var tagsCommand = new
|
|
4424
|
+
var import_commander39 = require("commander");
|
|
4425
|
+
var tagsCommand = new import_commander39.Command("tags").description("\uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD0DC\uADF8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").argument("<repository>", "\uC774\uBBF8\uC9C0(repository) \uC774\uB984 (\uC9E7\uC740 \uC774\uB984 \uB610\uB294 {project}/{repo})").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--app-key <key>", "NCR appKey (profile \uC758 ncr.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, repository, _opts, cmd) => {
|
|
4225
4426
|
const opts = cmd.optsWithGlobals();
|
|
4226
4427
|
if (!registry.trim()) {
|
|
4227
4428
|
throw new NhnCloudCliError(
|
|
@@ -4262,7 +4463,7 @@ var tagsCommand = new import_commander37.Command("tags").description("\uD2B9\uC8
|
|
|
4262
4463
|
});
|
|
4263
4464
|
|
|
4264
4465
|
// src/commands/commands.ts
|
|
4265
|
-
var
|
|
4466
|
+
var import_commander40 = require("commander");
|
|
4266
4467
|
function commandPath(command) {
|
|
4267
4468
|
const names = [];
|
|
4268
4469
|
let current2 = command;
|
|
@@ -4273,15 +4474,15 @@ function commandPath(command) {
|
|
|
4273
4474
|
return names.join(" ");
|
|
4274
4475
|
}
|
|
4275
4476
|
function collectCommand(command) {
|
|
4276
|
-
const
|
|
4277
|
-
if (!
|
|
4477
|
+
const path3 = commandPath(command);
|
|
4478
|
+
if (!path3 || path3 === "help") return null;
|
|
4278
4479
|
return {
|
|
4279
|
-
path,
|
|
4480
|
+
path: path3,
|
|
4280
4481
|
description: command.description() || command.summary() || "",
|
|
4281
4482
|
arguments: command.registeredArguments.map((arg) => arg.name()),
|
|
4282
4483
|
options: command.options.filter((option) => !option.hidden).map((option) => option.flags),
|
|
4283
4484
|
subcommands: command.commands.map((subcommand) => subcommand.name()).filter((name) => name !== "help"),
|
|
4284
|
-
...
|
|
4485
|
+
...path3 === "commands" ? { metadata: true } : {}
|
|
4285
4486
|
};
|
|
4286
4487
|
}
|
|
4287
4488
|
function collectCommandCatalog(program2) {
|
|
@@ -4300,7 +4501,7 @@ function collectCommandCatalog(program2) {
|
|
|
4300
4501
|
return { commands };
|
|
4301
4502
|
}
|
|
4302
4503
|
function createCommandsCommand(program2) {
|
|
4303
|
-
return new
|
|
4504
|
+
return new import_commander40.Command("commands").description("\uBA85\uB839 \uACBD\uB85C\uC640 \uC635\uC158 catalog\uB97C \uCD9C\uB825\uD55C\uB2E4").action((_opts, cmd) => {
|
|
4304
4505
|
const opts = cmd.optsWithGlobals();
|
|
4305
4506
|
const catalog = collectCommandCatalog(program2);
|
|
4306
4507
|
output(opts, {
|
|
@@ -4317,10 +4518,10 @@ function createCommandsCommand(program2) {
|
|
|
4317
4518
|
}
|
|
4318
4519
|
|
|
4319
4520
|
// src/commands/nks/supports.ts
|
|
4320
|
-
var
|
|
4521
|
+
var import_commander41 = require("commander");
|
|
4321
4522
|
|
|
4322
4523
|
// src/commands/nks/helpers.ts
|
|
4323
|
-
var
|
|
4524
|
+
var import_promises7 = require("fs/promises");
|
|
4324
4525
|
|
|
4325
4526
|
// src/services/nks/client.ts
|
|
4326
4527
|
var import_ky11 = __toESM(require("ky"));
|
|
@@ -4755,22 +4956,22 @@ var NksClient = class {
|
|
|
4755
4956
|
throw toNhnCloudCliError(err);
|
|
4756
4957
|
}
|
|
4757
4958
|
}
|
|
4758
|
-
async getNamedResourceArray(key,
|
|
4759
|
-
const raw = await this.getJson(
|
|
4959
|
+
async getNamedResourceArray(key, path3, errorMessage) {
|
|
4960
|
+
const raw = await this.getJson(path3);
|
|
4760
4961
|
if (!isNamedResourceArrayResponse(key, raw)) {
|
|
4761
4962
|
throw new NhnCloudCliError(errorMessage, EXIT_API_ERROR);
|
|
4762
4963
|
}
|
|
4763
4964
|
return raw[key];
|
|
4764
4965
|
}
|
|
4765
|
-
async getFlatNamedResource(
|
|
4766
|
-
const raw = await this.getJson(
|
|
4966
|
+
async getFlatNamedResource(path3, errorMessage) {
|
|
4967
|
+
const raw = await this.getJson(path3);
|
|
4767
4968
|
if (!isNksNamedResource(raw)) {
|
|
4768
4969
|
throw new NhnCloudCliError(errorMessage, EXIT_API_ERROR);
|
|
4769
4970
|
}
|
|
4770
4971
|
return raw;
|
|
4771
4972
|
}
|
|
4772
|
-
async getJson(
|
|
4773
|
-
const url = `${this.nksEndpoint}${
|
|
4973
|
+
async getJson(path3, searchParams) {
|
|
4974
|
+
const url = `${this.nksEndpoint}${path3}`;
|
|
4774
4975
|
try {
|
|
4775
4976
|
return await import_ky11.default.get(url, {
|
|
4776
4977
|
headers: this.authHeaders(),
|
|
@@ -4782,15 +4983,15 @@ var NksClient = class {
|
|
|
4782
4983
|
throw toNhnCloudCliError(err);
|
|
4783
4984
|
}
|
|
4784
4985
|
}
|
|
4785
|
-
async requestUuid(method,
|
|
4786
|
-
const raw = await this.requestJson(method,
|
|
4986
|
+
async requestUuid(method, path3, payload, errorMessage) {
|
|
4987
|
+
const raw = await this.requestJson(method, path3, payload);
|
|
4787
4988
|
if (!isNksUuidResponse(raw)) {
|
|
4788
4989
|
throw new NhnCloudCliError(errorMessage, EXIT_API_ERROR);
|
|
4789
4990
|
}
|
|
4790
4991
|
return raw;
|
|
4791
4992
|
}
|
|
4792
|
-
async requestNoBody(method,
|
|
4793
|
-
const url = `${this.nksEndpoint}${
|
|
4993
|
+
async requestNoBody(method, path3, payload) {
|
|
4994
|
+
const url = `${this.nksEndpoint}${path3}`;
|
|
4794
4995
|
try {
|
|
4795
4996
|
if (method === "delete") {
|
|
4796
4997
|
await import_ky11.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS7 });
|
|
@@ -4801,8 +5002,8 @@ var NksClient = class {
|
|
|
4801
5002
|
throw toNhnCloudCliError(err);
|
|
4802
5003
|
}
|
|
4803
5004
|
}
|
|
4804
|
-
async requestJson(method,
|
|
4805
|
-
const url = `${this.nksEndpoint}${
|
|
5005
|
+
async requestJson(method, path3, payload) {
|
|
5006
|
+
const url = `${this.nksEndpoint}${path3}`;
|
|
4806
5007
|
try {
|
|
4807
5008
|
const options = { headers: this.authHeaders(), json: payload, retry: 0, timeout: DEFAULT_TIMEOUT_MS7 };
|
|
4808
5009
|
return method === "post" ? await import_ky11.default.post(url, options).json() : await import_ky11.default.patch(url, options).json();
|
|
@@ -4825,13 +5026,13 @@ async function resolveNksClient(opts) {
|
|
|
4825
5026
|
const { profileName, tokenId, nksEndpoint } = await resolveIaasTokenContext(opts);
|
|
4826
5027
|
return { client: new NksClient(tokenId, nksEndpoint), profileName };
|
|
4827
5028
|
}
|
|
4828
|
-
async function readJsonFile(
|
|
5029
|
+
async function readJsonFile(path3) {
|
|
4829
5030
|
let raw;
|
|
4830
5031
|
try {
|
|
4831
|
-
raw = await (0,
|
|
5032
|
+
raw = await (0, import_promises7.readFile)(path3, "utf-8");
|
|
4832
5033
|
} catch (err) {
|
|
4833
5034
|
const message = err instanceof Error ? err.message : String(err);
|
|
4834
|
-
throw new NhnCloudCliError(`JSON \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${
|
|
5035
|
+
throw new NhnCloudCliError(`JSON \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${path3} (${message})`, EXIT_PARAM_ERROR);
|
|
4835
5036
|
}
|
|
4836
5037
|
try {
|
|
4837
5038
|
const parsed = JSON.parse(raw);
|
|
@@ -4841,15 +5042,15 @@ async function readJsonFile(path) {
|
|
|
4841
5042
|
return parsed;
|
|
4842
5043
|
} catch (err) {
|
|
4843
5044
|
const message = err instanceof Error ? err.message : String(err);
|
|
4844
|
-
throw new NhnCloudCliError(`JSON \uD30C\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: ${
|
|
5045
|
+
throw new NhnCloudCliError(`JSON \uD30C\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: ${path3} (${message})`, EXIT_PARAM_ERROR);
|
|
4845
5046
|
}
|
|
4846
5047
|
}
|
|
4847
|
-
async function readTextFile(
|
|
5048
|
+
async function readTextFile(path3) {
|
|
4848
5049
|
try {
|
|
4849
|
-
return await (0,
|
|
5050
|
+
return await (0, import_promises7.readFile)(path3, "utf-8");
|
|
4850
5051
|
} catch (err) {
|
|
4851
5052
|
const message = err instanceof Error ? err.message : String(err);
|
|
4852
|
-
throw new NhnCloudCliError(`\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${
|
|
5053
|
+
throw new NhnCloudCliError(`\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${path3} (${message})`, EXIT_PARAM_ERROR);
|
|
4853
5054
|
}
|
|
4854
5055
|
}
|
|
4855
5056
|
function parsePositiveInteger(value, optionName) {
|
|
@@ -4866,7 +5067,7 @@ function parseNonNegativeInteger(value, optionName) {
|
|
|
4866
5067
|
}
|
|
4867
5068
|
|
|
4868
5069
|
// src/commands/nks/supports.ts
|
|
4869
|
-
var supportsCommand = new
|
|
5070
|
+
var supportsCommand = new import_commander41.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) => {
|
|
4870
5071
|
const opts = cmd.optsWithGlobals();
|
|
4871
5072
|
const { client } = await resolveNksClient(opts);
|
|
4872
5073
|
startSpinner("NKS \uC9C0\uC6D0 \uC815\uBCF4 \uC870\uD68C \uC911...");
|
|
@@ -4890,10 +5091,10 @@ var supportsCommand = new import_commander39.Command("supports").description("NK
|
|
|
4890
5091
|
});
|
|
4891
5092
|
|
|
4892
5093
|
// src/commands/nks/cluster.ts
|
|
4893
|
-
var
|
|
4894
|
-
var
|
|
4895
|
-
var
|
|
4896
|
-
var listCommand6 = new
|
|
5094
|
+
var import_promises8 = require("fs/promises");
|
|
5095
|
+
var import_commander42 = require("commander");
|
|
5096
|
+
var import_chalk14 = __toESM(require("chalk"));
|
|
5097
|
+
var listCommand6 = new import_commander42.Command("list").description("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4897
5098
|
const opts = cmd.optsWithGlobals();
|
|
4898
5099
|
const { client } = await resolveNksClient(opts);
|
|
4899
5100
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -4946,7 +5147,7 @@ function clusterIpAclRow(ipAcl) {
|
|
|
4946
5147
|
];
|
|
4947
5148
|
}
|
|
4948
5149
|
function uuidOutput(opts, result, label) {
|
|
4949
|
-
process.stderr.write(
|
|
5150
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
4950
5151
|
`));
|
|
4951
5152
|
output(opts, {
|
|
4952
5153
|
headers: ["field", "value"],
|
|
@@ -4967,29 +5168,29 @@ async function confirmDangerousAction(message, yes) {
|
|
|
4967
5168
|
const { confirm } = await import("@inquirer/prompts");
|
|
4968
5169
|
const ok = await confirm({ message, default: false });
|
|
4969
5170
|
if (!ok) {
|
|
4970
|
-
process.stderr.write(
|
|
5171
|
+
process.stderr.write(import_chalk14.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
4971
5172
|
}
|
|
4972
5173
|
return ok;
|
|
4973
5174
|
}
|
|
4974
|
-
async function writeKubeconfigFile(
|
|
5175
|
+
async function writeKubeconfigFile(path3, contents, force) {
|
|
4975
5176
|
try {
|
|
4976
|
-
await (0,
|
|
5177
|
+
await (0, import_promises8.writeFile)(path3, contents, {
|
|
4977
5178
|
encoding: "utf-8",
|
|
4978
5179
|
mode: 384,
|
|
4979
5180
|
flag: force ? "w" : "wx"
|
|
4980
5181
|
});
|
|
4981
|
-
await (0,
|
|
5182
|
+
await (0, import_promises8.chmod)(path3, 384);
|
|
4982
5183
|
} catch (err) {
|
|
4983
5184
|
if (err instanceof Error && "code" in err && err.code === "EEXIST") {
|
|
4984
5185
|
throw new NhnCloudCliError(
|
|
4985
|
-
`\uD30C\uC77C\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${
|
|
5186
|
+
`\uD30C\uC77C\uC774 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4: ${path3}. \uB36E\uC5B4\uC4F0\uB824\uBA74 --force \uB97C \uC9C0\uC815\uD558\uC138\uC694.`,
|
|
4986
5187
|
EXIT_PARAM_ERROR
|
|
4987
5188
|
);
|
|
4988
5189
|
}
|
|
4989
5190
|
throw err;
|
|
4990
5191
|
}
|
|
4991
5192
|
}
|
|
4992
|
-
var createCommand4 = new
|
|
5193
|
+
var createCommand4 = new import_commander42.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) => {
|
|
4993
5194
|
const opts = cmd.optsWithGlobals();
|
|
4994
5195
|
const payload = await readJsonFile(opts.file);
|
|
4995
5196
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5004,7 +5205,7 @@ var createCommand4 = new import_commander40.Command("create").description("NKS \
|
|
|
5004
5205
|
stopSpinner(true);
|
|
5005
5206
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC0DD\uC131");
|
|
5006
5207
|
});
|
|
5007
|
-
var deleteCommand3 = new
|
|
5208
|
+
var deleteCommand3 = new import_commander42.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) => {
|
|
5008
5209
|
const opts = cmd.optsWithGlobals();
|
|
5009
5210
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
5010
5211
|
if (!ok) return;
|
|
@@ -5017,15 +5218,15 @@ var deleteCommand3 = new import_commander40.Command("delete").description("NKS \
|
|
|
5017
5218
|
throw err;
|
|
5018
5219
|
}
|
|
5019
5220
|
stopSpinner(true);
|
|
5020
|
-
process.stderr.write(
|
|
5221
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
5021
5222
|
`));
|
|
5022
5223
|
});
|
|
5023
|
-
var resizeCommand2 = new
|
|
5224
|
+
var resizeCommand2 = new import_commander42.Command("resize").description("NKS \uD074\uB7EC\uC2A4\uD130 \uB178\uB4DC \uADF8\uB8F9 \uD06C\uAE30\uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--nodegroup <name-or-uuid>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--node-count <n>", "\uBCC0\uACBD\uD560 \uB178\uB4DC \uC218").option("--nodes-to-remove <csv>", "\uC0AD\uC81C\uD560 \uB178\uB4DC \uC774\uB984/ID CSV").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, _opts, cmd) => {
|
|
5024
5225
|
const opts = cmd.optsWithGlobals();
|
|
5025
5226
|
const nodeCount = parsePositiveInteger(opts.nodeCount, "--node-count");
|
|
5026
5227
|
const nodesToRemove = opts.nodesToRemove?.split(",").map((node) => node.trim()).filter(Boolean);
|
|
5027
5228
|
if (!nodesToRemove || nodesToRemove.length === 0) {
|
|
5028
|
-
process.stderr.write(
|
|
5229
|
+
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"));
|
|
5029
5230
|
}
|
|
5030
5231
|
const { client } = await resolveNksClient(opts);
|
|
5031
5232
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 resize \uC694\uCCAD \uC911...");
|
|
@@ -5044,7 +5245,7 @@ var resizeCommand2 = new import_commander40.Command("resize").description("NKS \
|
|
|
5044
5245
|
stopSpinner(true);
|
|
5045
5246
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 resize");
|
|
5046
5247
|
});
|
|
5047
|
-
var setIpAclCommand = new
|
|
5248
|
+
var setIpAclCommand = new import_commander42.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) => {
|
|
5048
5249
|
const opts = cmd.optsWithGlobals();
|
|
5049
5250
|
const payload = await readJsonFile(opts.file);
|
|
5050
5251
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5059,7 +5260,7 @@ var setIpAclCommand = new import_commander40.Command("set-ipacl").description("N
|
|
|
5059
5260
|
stopSpinner(true);
|
|
5060
5261
|
uuidOutput(opts, result, "IP ACL \uC124\uC815");
|
|
5061
5262
|
});
|
|
5062
|
-
var renewCertificateCommand = new
|
|
5263
|
+
var renewCertificateCommand = new import_commander42.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) => {
|
|
5063
5264
|
const opts = cmd.optsWithGlobals();
|
|
5064
5265
|
const term = parsePositiveInteger(opts.termOfValidity, "--term-of-validity");
|
|
5065
5266
|
if (term < 1 || term > 5) {
|
|
@@ -5077,7 +5278,7 @@ var renewCertificateCommand = new import_commander40.Command("renew-certificate"
|
|
|
5077
5278
|
stopSpinner(true);
|
|
5078
5279
|
uuidOutput(opts, result, "\uC778\uC99D\uC11C \uAC31\uC2E0");
|
|
5079
5280
|
});
|
|
5080
|
-
var updateSgwCommand = new
|
|
5281
|
+
var updateSgwCommand = new import_commander42.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) => {
|
|
5081
5282
|
const opts = cmd.optsWithGlobals();
|
|
5082
5283
|
const { client } = await resolveNksClient(opts);
|
|
5083
5284
|
startSpinner("NKS \uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -5091,7 +5292,7 @@ var updateSgwCommand = new import_commander40.Command("update-sgw").description(
|
|
|
5091
5292
|
stopSpinner(true);
|
|
5092
5293
|
uuidOutput(opts, result, "\uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD");
|
|
5093
5294
|
});
|
|
5094
|
-
var setControlPlaneLogCommand = new
|
|
5295
|
+
var setControlPlaneLogCommand = new import_commander42.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) => {
|
|
5095
5296
|
const opts = cmd.optsWithGlobals();
|
|
5096
5297
|
const controlPlaneLog = await readJsonFile(opts.file);
|
|
5097
5298
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5106,7 +5307,7 @@ var setControlPlaneLogCommand = new import_commander40.Command("set-control-plan
|
|
|
5106
5307
|
stopSpinner(true);
|
|
5107
5308
|
uuidOutput(opts, result, "control plane log \uC124\uC815");
|
|
5108
5309
|
});
|
|
5109
|
-
var getCommand4 = new
|
|
5310
|
+
var getCommand4 = new import_commander42.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) => {
|
|
5110
5311
|
const opts = cmd.optsWithGlobals();
|
|
5111
5312
|
const { client } = await resolveNksClient(opts);
|
|
5112
5313
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC870\uD68C \uC911...");
|
|
@@ -5125,7 +5326,7 @@ var getCommand4 = new import_commander40.Command("get").description("NKS \uD074\
|
|
|
5125
5326
|
ids: [resourceId(result)]
|
|
5126
5327
|
});
|
|
5127
5328
|
});
|
|
5128
|
-
var eventsCommand = new
|
|
5329
|
+
var eventsCommand = new import_commander42.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) => {
|
|
5129
5330
|
const opts = cmd.optsWithGlobals();
|
|
5130
5331
|
const { client } = await resolveNksClient(opts);
|
|
5131
5332
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uC870\uD68C \uC911...");
|
|
@@ -5144,7 +5345,7 @@ var eventsCommand = new import_commander40.Command("events").description("NKS \u
|
|
|
5144
5345
|
ids: events.map(resourceId)
|
|
5145
5346
|
});
|
|
5146
5347
|
});
|
|
5147
|
-
var eventCommand = new
|
|
5348
|
+
var eventCommand = new import_commander42.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 \uB610\uB294 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 (cluster, event, _opts, cmd) => {
|
|
5148
5349
|
const opts = cmd.optsWithGlobals();
|
|
5149
5350
|
const { client } = await resolveNksClient(opts);
|
|
5150
5351
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uC870\uD68C \uC911...");
|
|
@@ -5163,7 +5364,7 @@ var eventCommand = new import_commander40.Command("event").description("NKS \uD0
|
|
|
5163
5364
|
ids: [resourceId(result)]
|
|
5164
5365
|
});
|
|
5165
5366
|
});
|
|
5166
|
-
var kubeconfigCommand = new
|
|
5367
|
+
var kubeconfigCommand = new import_commander42.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) => {
|
|
5167
5368
|
const opts = cmd.optsWithGlobals();
|
|
5168
5369
|
const { client } = await resolveNksClient(opts);
|
|
5169
5370
|
startSpinner("NKS kubeconfig \uC870\uD68C \uC911...");
|
|
@@ -5177,13 +5378,13 @@ var kubeconfigCommand = new import_commander40.Command("kubeconfig").description
|
|
|
5177
5378
|
stopSpinner(true);
|
|
5178
5379
|
if (opts.output) {
|
|
5179
5380
|
await writeKubeconfigFile(opts.output, kubeconfig, opts.force);
|
|
5180
|
-
process.stderr.write(
|
|
5381
|
+
process.stderr.write(import_chalk14.default.green(`\u2713 kubeconfig \uB97C \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4: ${opts.output}
|
|
5181
5382
|
`));
|
|
5182
5383
|
return;
|
|
5183
5384
|
}
|
|
5184
5385
|
process.stdout.write(kubeconfig.endsWith("\n") ? kubeconfig : kubeconfig + "\n");
|
|
5185
5386
|
});
|
|
5186
|
-
var ipAclCommand = new
|
|
5387
|
+
var ipAclCommand = new import_commander42.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) => {
|
|
5187
5388
|
const opts = cmd.optsWithGlobals();
|
|
5188
5389
|
const { client } = await resolveNksClient(opts);
|
|
5189
5390
|
startSpinner("NKS IP ACL \uC870\uD68C \uC911...");
|
|
@@ -5202,7 +5403,7 @@ var ipAclCommand = new import_commander40.Command("ipacl").description("NKS \uD0
|
|
|
5202
5403
|
ids: [result.cluster_uuid]
|
|
5203
5404
|
});
|
|
5204
5405
|
});
|
|
5205
|
-
var clusterAddonListCommand = new
|
|
5406
|
+
var clusterAddonListCommand = new import_commander42.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) => {
|
|
5206
5407
|
const opts = cmd.optsWithGlobals();
|
|
5207
5408
|
const { client } = await resolveNksClient(opts);
|
|
5208
5409
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5221,7 +5422,7 @@ var clusterAddonListCommand = new import_commander40.Command("list").description
|
|
|
5221
5422
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
5222
5423
|
});
|
|
5223
5424
|
});
|
|
5224
|
-
var clusterAddonGetCommand = new
|
|
5425
|
+
var clusterAddonGetCommand = new import_commander42.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) => {
|
|
5225
5426
|
const opts = cmd.optsWithGlobals();
|
|
5226
5427
|
const { client } = await resolveNksClient(opts);
|
|
5227
5428
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -5249,7 +5450,7 @@ function parseResolveConflicts(value) {
|
|
|
5249
5450
|
EXIT_PARAM_ERROR
|
|
5250
5451
|
);
|
|
5251
5452
|
}
|
|
5252
|
-
var clusterAddonInstallCommand = new
|
|
5453
|
+
var clusterAddonInstallCommand = new import_commander42.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("--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) => {
|
|
5253
5454
|
const opts = cmd.optsWithGlobals();
|
|
5254
5455
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
5255
5456
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5268,7 +5469,7 @@ var clusterAddonInstallCommand = new import_commander40.Command("install").descr
|
|
|
5268
5469
|
stopSpinner(true);
|
|
5269
5470
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC124\uCE58");
|
|
5270
5471
|
});
|
|
5271
|
-
var clusterAddonUpdateCommand = new
|
|
5472
|
+
var clusterAddonUpdateCommand = new import_commander42.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("--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) => {
|
|
5272
5473
|
const opts = cmd.optsWithGlobals();
|
|
5273
5474
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
5274
5475
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5286,7 +5487,7 @@ var clusterAddonUpdateCommand = new import_commander40.Command("update").descrip
|
|
|
5286
5487
|
stopSpinner(true);
|
|
5287
5488
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC5C5\uB370\uC774\uD2B8");
|
|
5288
5489
|
});
|
|
5289
|
-
var clusterAddonRemoveCommand = new
|
|
5490
|
+
var clusterAddonRemoveCommand = new import_commander42.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) => {
|
|
5290
5491
|
const opts = cmd.optsWithGlobals();
|
|
5291
5492
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 "${addon}" \uC744 \uC81C\uAC70\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
5292
5493
|
if (!ok) return;
|
|
@@ -5302,12 +5503,12 @@ var clusterAddonRemoveCommand = new import_commander40.Command("remove").descrip
|
|
|
5302
5503
|
stopSpinner(true);
|
|
5303
5504
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC81C\uAC70");
|
|
5304
5505
|
});
|
|
5305
|
-
var clusterAddonCommand = new
|
|
5306
|
-
var clusterCommand = new
|
|
5506
|
+
var clusterAddonCommand = new import_commander42.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);
|
|
5507
|
+
var clusterCommand = new import_commander42.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);
|
|
5307
5508
|
|
|
5308
5509
|
// src/commands/nks/nodegroup.ts
|
|
5309
|
-
var
|
|
5310
|
-
var
|
|
5510
|
+
var import_commander43 = require("commander");
|
|
5511
|
+
var import_chalk15 = __toESM(require("chalk"));
|
|
5311
5512
|
function nodeGroupRow(nodegroup) {
|
|
5312
5513
|
return [
|
|
5313
5514
|
nodegroup.uuid,
|
|
@@ -5324,7 +5525,7 @@ function rawObjectRows(resource) {
|
|
|
5324
5525
|
]);
|
|
5325
5526
|
}
|
|
5326
5527
|
function uuidOutput2(opts, result, label) {
|
|
5327
|
-
process.stderr.write(
|
|
5528
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 ${label} \uC694\uCCAD \uC644\uB8CC (uuid: ${result.uuid})
|
|
5328
5529
|
`));
|
|
5329
5530
|
output(opts, {
|
|
5330
5531
|
headers: ["field", "value"],
|
|
@@ -5357,10 +5558,10 @@ async function confirmDangerousAction2(message, yes) {
|
|
|
5357
5558
|
if (!isTTY || yes) return true;
|
|
5358
5559
|
const { confirm } = await import("@inquirer/prompts");
|
|
5359
5560
|
const ok = await confirm({ message, default: false });
|
|
5360
|
-
if (!ok) process.stderr.write(
|
|
5561
|
+
if (!ok) process.stderr.write(import_chalk15.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
5361
5562
|
return ok;
|
|
5362
5563
|
}
|
|
5363
|
-
var listCommand7 = new
|
|
5564
|
+
var listCommand7 = new import_commander43.Command("list").description("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, _opts, cmd) => {
|
|
5364
5565
|
const opts = cmd.optsWithGlobals();
|
|
5365
5566
|
const { client } = await resolveNksClient(opts);
|
|
5366
5567
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5379,7 +5580,7 @@ var listCommand7 = new import_commander41.Command("list").description("NKS \uB17
|
|
|
5379
5580
|
ids: nodegroups.map((nodegroup) => nodegroup.uuid)
|
|
5380
5581
|
});
|
|
5381
5582
|
});
|
|
5382
|
-
var getCommand5 = new
|
|
5583
|
+
var getCommand5 = new import_commander43.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) => {
|
|
5383
5584
|
const opts = cmd.optsWithGlobals();
|
|
5384
5585
|
const { client } = await resolveNksClient(opts);
|
|
5385
5586
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uC870\uD68C \uC911...");
|
|
@@ -5398,7 +5599,7 @@ var getCommand5 = new import_commander41.Command("get").description("NKS \uB178\
|
|
|
5398
5599
|
ids: [result.uuid]
|
|
5399
5600
|
});
|
|
5400
5601
|
});
|
|
5401
|
-
var createCommand5 = new
|
|
5602
|
+
var createCommand5 = new import_commander43.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) => {
|
|
5402
5603
|
const opts = cmd.optsWithGlobals();
|
|
5403
5604
|
const payload = await readJsonFile(opts.file);
|
|
5404
5605
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5413,7 +5614,7 @@ var createCommand5 = new import_commander41.Command("create").description("NKS \
|
|
|
5413
5614
|
stopSpinner(true);
|
|
5414
5615
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 \uC0DD\uC131");
|
|
5415
5616
|
});
|
|
5416
|
-
var deleteCommand4 = new
|
|
5617
|
+
var deleteCommand4 = new import_commander43.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) => {
|
|
5417
5618
|
const opts = cmd.optsWithGlobals();
|
|
5418
5619
|
const ok = await confirmDangerousAction2(`NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
5419
5620
|
if (!ok) return;
|
|
@@ -5426,11 +5627,11 @@ var deleteCommand4 = new import_commander41.Command("delete").description("NKS \
|
|
|
5426
5627
|
throw err;
|
|
5427
5628
|
}
|
|
5428
5629
|
stopSpinner(true);
|
|
5429
|
-
process.stderr.write(
|
|
5630
|
+
process.stderr.write(import_chalk15.default.green(`\u2713 NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
5430
5631
|
`));
|
|
5431
5632
|
});
|
|
5432
5633
|
function nodeActionCommand(name) {
|
|
5433
|
-
return new
|
|
5634
|
+
return new import_commander43.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) => {
|
|
5434
5635
|
const opts = cmd.optsWithGlobals();
|
|
5435
5636
|
const nodes = parseCsv(opts.nodes, "--nodes");
|
|
5436
5637
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5446,7 +5647,7 @@ function nodeActionCommand(name) {
|
|
|
5446
5647
|
uuidOutput2(opts, result, `\uB178\uB4DC ${name === "stop-node" ? "\uC911\uC9C0" : "\uC2DC\uC791"}`);
|
|
5447
5648
|
});
|
|
5448
5649
|
}
|
|
5449
|
-
var autoscaleCommand = new
|
|
5650
|
+
var autoscaleCommand = new import_commander43.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) => {
|
|
5450
5651
|
const opts = cmd.optsWithGlobals();
|
|
5451
5652
|
const { client } = await resolveNksClient(opts);
|
|
5452
5653
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC870\uD68C \uC911...");
|
|
@@ -5465,7 +5666,7 @@ var autoscaleCommand = new import_commander41.Command("autoscale").description("
|
|
|
5465
5666
|
ids: []
|
|
5466
5667
|
});
|
|
5467
5668
|
});
|
|
5468
|
-
var setAutoscaleCommand = new
|
|
5669
|
+
var setAutoscaleCommand = new import_commander43.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) => {
|
|
5469
5670
|
const opts = cmd.optsWithGlobals();
|
|
5470
5671
|
const payload = await readJsonFile(opts.file);
|
|
5471
5672
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5480,7 +5681,7 @@ var setAutoscaleCommand = new import_commander41.Command("set-autoscale").descri
|
|
|
5480
5681
|
stopSpinner(true);
|
|
5481
5682
|
uuidOutput2(opts, result, "autoscale \uBCC0\uACBD");
|
|
5482
5683
|
});
|
|
5483
|
-
var setMetricAutoscaleCommand = new
|
|
5684
|
+
var setMetricAutoscaleCommand = new import_commander43.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) => {
|
|
5484
5685
|
const opts = cmd.optsWithGlobals();
|
|
5485
5686
|
const payload = await readJsonFile(opts.file);
|
|
5486
5687
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5495,7 +5696,7 @@ var setMetricAutoscaleCommand = new import_commander41.Command("set-metric-autos
|
|
|
5495
5696
|
stopSpinner(true);
|
|
5496
5697
|
uuidOutput2(opts, result, "metric autoscale \uBCC0\uACBD");
|
|
5497
5698
|
});
|
|
5498
|
-
var upgradeCommand = new
|
|
5699
|
+
var upgradeCommand = new import_commander43.Command("upgrade").description("NKS \uB178\uB4DC \uADF8\uB8F9 Kubernetes version \uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\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("--version <v>", "\uB300\uC0C1 Kubernetes version").option("--num-buffer-nodes <n>", "buffer node \uC218").option("--num-max-unavailable-nodes <n>", "\uCD5C\uB300 unavailable node \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) => {
|
|
5499
5700
|
const opts = cmd.optsWithGlobals();
|
|
5500
5701
|
const { client } = await resolveNksClient(opts);
|
|
5501
5702
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 upgrade \uC694\uCCAD \uC911...");
|
|
@@ -5513,7 +5714,7 @@ var upgradeCommand = new import_commander41.Command("upgrade").description("NKS
|
|
|
5513
5714
|
stopSpinner(true);
|
|
5514
5715
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 upgrade");
|
|
5515
5716
|
});
|
|
5516
|
-
var setUserscriptCommand = new
|
|
5717
|
+
var setUserscriptCommand = new import_commander43.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) => {
|
|
5517
5718
|
const opts = cmd.optsWithGlobals();
|
|
5518
5719
|
const contents = await readTextFile(opts.file);
|
|
5519
5720
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5528,7 +5729,7 @@ var setUserscriptCommand = new import_commander41.Command("set-userscript").desc
|
|
|
5528
5729
|
stopSpinner(true);
|
|
5529
5730
|
uuidOutput2(opts, result, "user script \uBCC0\uACBD");
|
|
5530
5731
|
});
|
|
5531
|
-
var updateFlavorCommand = new
|
|
5732
|
+
var updateFlavorCommand = new import_commander43.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>", "buffer node \uC218").option("--num-max-unavailable-nodes <n>", "\uCD5C\uB300 unavailable node \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) => {
|
|
5532
5733
|
const opts = cmd.optsWithGlobals();
|
|
5533
5734
|
const { client } = await resolveNksClient(opts);
|
|
5534
5735
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -5547,7 +5748,7 @@ var updateFlavorCommand = new import_commander41.Command("update-flavor").descri
|
|
|
5547
5748
|
uuidOutput2(opts, result, "flavor \uBCC0\uACBD");
|
|
5548
5749
|
});
|
|
5549
5750
|
function patchPayloadCommand(name) {
|
|
5550
|
-
return new
|
|
5751
|
+
return new import_commander43.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) => {
|
|
5551
5752
|
const opts = cmd.optsWithGlobals();
|
|
5552
5753
|
const payload = await readJsonFile(opts.file);
|
|
5553
5754
|
const { client } = await resolveNksClient(opts);
|
|
@@ -5563,10 +5764,10 @@ function patchPayloadCommand(name) {
|
|
|
5563
5764
|
uuidOutput2(opts, result, name);
|
|
5564
5765
|
});
|
|
5565
5766
|
}
|
|
5566
|
-
var nodegroupCommand = new
|
|
5767
|
+
var nodegroupCommand = new import_commander43.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"));
|
|
5567
5768
|
|
|
5568
5769
|
// src/commands/nks/addon.ts
|
|
5569
|
-
var
|
|
5770
|
+
var import_commander44 = require("commander");
|
|
5570
5771
|
function addonTypeRow(addonType) {
|
|
5571
5772
|
return [
|
|
5572
5773
|
addonType.uuid ?? addonType.id ?? addonType.name,
|
|
@@ -5582,7 +5783,7 @@ function addonRow2(addon) {
|
|
|
5582
5783
|
addon.status ?? ""
|
|
5583
5784
|
];
|
|
5584
5785
|
}
|
|
5585
|
-
var addonTypeListCommand = new
|
|
5786
|
+
var addonTypeListCommand = new import_commander44.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) => {
|
|
5586
5787
|
const opts = cmd.optsWithGlobals();
|
|
5587
5788
|
const { client } = await resolveNksClient(opts);
|
|
5588
5789
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5601,7 +5802,7 @@ var addonTypeListCommand = new import_commander42.Command("list").description("N
|
|
|
5601
5802
|
ids: addonTypes.map((addonType) => addonType.uuid ?? addonType.id ?? addonType.name)
|
|
5602
5803
|
});
|
|
5603
5804
|
});
|
|
5604
|
-
var addonTypeGetCommand = new
|
|
5805
|
+
var addonTypeGetCommand = new import_commander44.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) => {
|
|
5605
5806
|
const opts = cmd.optsWithGlobals();
|
|
5606
5807
|
const { client } = await resolveNksClient(opts);
|
|
5607
5808
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uC870\uD68C \uC911...");
|
|
@@ -5620,8 +5821,8 @@ var addonTypeGetCommand = new import_commander42.Command("get").description("NKS
|
|
|
5620
5821
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
5621
5822
|
});
|
|
5622
5823
|
});
|
|
5623
|
-
var addonTypeCommand = new
|
|
5624
|
-
var addonListCommand = new
|
|
5824
|
+
var addonTypeCommand = new import_commander44.Command("addon-type").description("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uAD00\uB828 \uBA85\uB839").addCommand(addonTypeListCommand).addCommand(addonTypeGetCommand);
|
|
5825
|
+
var addonListCommand = new import_commander44.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) => {
|
|
5625
5826
|
const opts = cmd.optsWithGlobals();
|
|
5626
5827
|
const { client } = await resolveNksClient(opts);
|
|
5627
5828
|
startSpinner("NKS \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5644,7 +5845,7 @@ var addonListCommand = new import_commander42.Command("list").description("NKS \
|
|
|
5644
5845
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
5645
5846
|
});
|
|
5646
5847
|
});
|
|
5647
|
-
var addonGetCommand = new
|
|
5848
|
+
var addonGetCommand = new import_commander44.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) => {
|
|
5648
5849
|
const opts = cmd.optsWithGlobals();
|
|
5649
5850
|
const { client } = await resolveNksClient(opts);
|
|
5650
5851
|
startSpinner("NKS \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -5663,11 +5864,11 @@ var addonGetCommand = new import_commander42.Command("get").description("NKS \uC
|
|
|
5663
5864
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
5664
5865
|
});
|
|
5665
5866
|
});
|
|
5666
|
-
var addonCommand = new
|
|
5867
|
+
var addonCommand = new import_commander44.Command("addon").description("NKS \uC560\uB4DC\uC628 \uAD00\uB828 \uBA85\uB839").addCommand(addonListCommand).addCommand(addonGetCommand);
|
|
5667
5868
|
|
|
5668
5869
|
// src/commands/ncs/template.ts
|
|
5669
|
-
var
|
|
5670
|
-
var
|
|
5870
|
+
var import_commander45 = require("commander");
|
|
5871
|
+
var import_chalk16 = __toESM(require("chalk"));
|
|
5671
5872
|
|
|
5672
5873
|
// src/commands/ncs/helpers.ts
|
|
5673
5874
|
var import_node_fs7 = require("fs");
|
|
@@ -6575,7 +6776,7 @@ async function confirmDestructive(message, yes) {
|
|
|
6575
6776
|
}
|
|
6576
6777
|
|
|
6577
6778
|
// src/commands/ncs/template.ts
|
|
6578
|
-
var listCommand8 = new
|
|
6779
|
+
var listCommand8 = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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) => {
|
|
6579
6780
|
const opts = cmd.optsWithGlobals();
|
|
6580
6781
|
const { client } = await resolveNcsClient(opts);
|
|
6581
6782
|
startSpinner("NCS \uC124\uACC4\uB3C4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6606,7 +6807,7 @@ var listCommand8 = new import_commander43.Command("list").description("NCS \uC12
|
|
|
6606
6807
|
ids: templates.map((t) => t.id)
|
|
6607
6808
|
});
|
|
6608
6809
|
});
|
|
6609
|
-
var getCommand6 = new
|
|
6810
|
+
var getCommand6 = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
6610
6811
|
const opts = cmd.optsWithGlobals();
|
|
6611
6812
|
requireNonEmpty(id, "id");
|
|
6612
6813
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6634,7 +6835,7 @@ var getCommand6 = new import_commander43.Command("get").description("NCS \uC124\
|
|
|
6634
6835
|
ids: [template.id]
|
|
6635
6836
|
});
|
|
6636
6837
|
});
|
|
6637
|
-
var createCommand6 = new
|
|
6838
|
+
var createCommand6 = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "template \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
6638
6839
|
const opts = cmd.optsWithGlobals();
|
|
6639
6840
|
const payload = readJsonPayload(opts.file);
|
|
6640
6841
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6662,12 +6863,12 @@ var createCommand6 = new import_commander43.Command("create").description("NCS \
|
|
|
6662
6863
|
ids: [template.id]
|
|
6663
6864
|
});
|
|
6664
6865
|
});
|
|
6665
|
-
var deleteCommand5 = new
|
|
6866
|
+
var deleteCommand5 = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
6666
6867
|
const opts = cmd.optsWithGlobals();
|
|
6667
6868
|
requireNonEmpty(id, "id");
|
|
6668
6869
|
const ok = await confirmDestructive(`NCS \uC124\uACC4\uB3C4 "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
6669
6870
|
if (!ok) {
|
|
6670
|
-
process.stderr.write(
|
|
6871
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
6671
6872
|
return;
|
|
6672
6873
|
}
|
|
6673
6874
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6679,10 +6880,10 @@ var deleteCommand5 = new import_commander43.Command("delete").description("NCS \
|
|
|
6679
6880
|
throw err;
|
|
6680
6881
|
}
|
|
6681
6882
|
stopSpinner(true);
|
|
6682
|
-
process.stderr.write(
|
|
6883
|
+
process.stderr.write(import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
6683
6884
|
`));
|
|
6684
6885
|
});
|
|
6685
|
-
var versionListCommand = new
|
|
6886
|
+
var versionListCommand = new import_commander45.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uBC84\uC804 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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) => {
|
|
6686
6887
|
const opts = cmd.optsWithGlobals();
|
|
6687
6888
|
requireNonEmpty(id, "id");
|
|
6688
6889
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6715,7 +6916,7 @@ var versionListCommand = new import_commander43.Command("list").description("NCS
|
|
|
6715
6916
|
ids: versions.map((v) => v.id)
|
|
6716
6917
|
});
|
|
6717
6918
|
});
|
|
6718
|
-
var versionGetCommand = new
|
|
6919
|
+
var versionGetCommand = new import_commander45.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
6719
6920
|
const opts = cmd.optsWithGlobals();
|
|
6720
6921
|
requireNonEmpty(id, "id");
|
|
6721
6922
|
requireNonEmpty(version, "version");
|
|
@@ -6736,7 +6937,7 @@ var versionGetCommand = new import_commander43.Command("get").description("NCS \
|
|
|
6736
6937
|
ids: [detail.id]
|
|
6737
6938
|
});
|
|
6738
6939
|
});
|
|
6739
|
-
var versionCreateCommand = new
|
|
6940
|
+
var versionCreateCommand = new import_commander45.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uC0C8 \uBC84\uC804\uC744 \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, sourceVersion \uD544\uC218)").argument("<id>", "template ID").requiredOption("--file <path>", "\uBC84\uC804 \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C (sourceVersion \uD544\uB4DC \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
6740
6941
|
const opts = cmd.optsWithGlobals();
|
|
6741
6942
|
requireNonEmpty(id, "id");
|
|
6742
6943
|
const payload = readJsonPayload(opts.file);
|
|
@@ -6757,7 +6958,7 @@ var versionCreateCommand = new import_commander43.Command("create").description(
|
|
|
6757
6958
|
ids: [version.id]
|
|
6758
6959
|
});
|
|
6759
6960
|
});
|
|
6760
|
-
var versionDeleteCommand = new
|
|
6961
|
+
var versionDeleteCommand = new import_commander45.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
6761
6962
|
const opts = cmd.optsWithGlobals();
|
|
6762
6963
|
requireNonEmpty(id, "id");
|
|
6763
6964
|
requireNonEmpty(version, "version");
|
|
@@ -6766,7 +6967,7 @@ var versionDeleteCommand = new import_commander43.Command("delete").description(
|
|
|
6766
6967
|
opts.yes
|
|
6767
6968
|
);
|
|
6768
6969
|
if (!ok) {
|
|
6769
|
-
process.stderr.write(
|
|
6970
|
+
process.stderr.write(import_chalk16.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
6770
6971
|
return;
|
|
6771
6972
|
}
|
|
6772
6973
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6779,16 +6980,16 @@ var versionDeleteCommand = new import_commander43.Command("delete").description(
|
|
|
6779
6980
|
}
|
|
6780
6981
|
stopSpinner(true);
|
|
6781
6982
|
process.stderr.write(
|
|
6782
|
-
|
|
6983
|
+
import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uBC84\uC804 "${version}" \uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
6783
6984
|
`)
|
|
6784
6985
|
);
|
|
6785
6986
|
});
|
|
6786
|
-
var versionCommand = new
|
|
6787
|
-
var templateCommand = new
|
|
6987
|
+
var versionCommand = new import_commander45.Command("version").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uAD00\uB9AC").addCommand(versionListCommand).addCommand(versionGetCommand).addCommand(versionCreateCommand).addCommand(versionDeleteCommand);
|
|
6988
|
+
var templateCommand = new import_commander45.Command("template").description("NCS \uC124\uACC4\uB3C4(template) \uAD00\uB9AC").addCommand(listCommand8).addCommand(getCommand6).addCommand(createCommand6).addCommand(deleteCommand5).addCommand(versionCommand);
|
|
6788
6989
|
|
|
6789
6990
|
// src/commands/ncs/workload.ts
|
|
6790
|
-
var
|
|
6791
|
-
var
|
|
6991
|
+
var import_commander46 = require("commander");
|
|
6992
|
+
var import_chalk17 = __toESM(require("chalk"));
|
|
6792
6993
|
function workloadRows(w) {
|
|
6793
6994
|
return [
|
|
6794
6995
|
[
|
|
@@ -6802,7 +7003,7 @@ function workloadRows(w) {
|
|
|
6802
7003
|
];
|
|
6803
7004
|
}
|
|
6804
7005
|
var WORKLOAD_HEADERS = ["id", "name", "type", "status", "desired", "available"];
|
|
6805
|
-
var listCommand9 = new
|
|
7006
|
+
var listCommand9 = new import_commander46.Command("list").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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) => {
|
|
6806
7007
|
const opts = cmd.optsWithGlobals();
|
|
6807
7008
|
const { client } = await resolveNcsClient(opts);
|
|
6808
7009
|
startSpinner("NCS workload \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6835,7 +7036,7 @@ var listCommand9 = new import_commander44.Command("list").description("NCS workl
|
|
|
6835
7036
|
ids: workloads.map((w) => w.id)
|
|
6836
7037
|
});
|
|
6837
7038
|
});
|
|
6838
|
-
var getCommand7 = new
|
|
7039
|
+
var getCommand7 = new import_commander46.Command("get").description("NCS workload \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
6839
7040
|
const opts = cmd.optsWithGlobals();
|
|
6840
7041
|
requireNonEmpty(id, "id");
|
|
6841
7042
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -6865,7 +7066,7 @@ var getCommand7 = new import_commander44.Command("get").description("NCS workloa
|
|
|
6865
7066
|
ids: [workload.id]
|
|
6866
7067
|
});
|
|
6867
7068
|
});
|
|
6868
|
-
var logsCommand = new
|
|
7069
|
+
var logsCommand = new import_commander46.Command("logs").description("NCS workload task \uC758 \uCEE8\uD14C\uC774\uB108 \uB85C\uADF8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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("--from <time>", "\uB85C\uADF8 \uC2DC\uC791 \uC2DC\uAC04 (\uAE30\uBCF8: \uD604\uC7AC\uB85C\uBD80\uD130 5\uBD84 \uC804)").option("--to <time>", "\uB85C\uADF8 \uC885\uB8CC \uC2DC\uAC04 (\uAE30\uBCF8: \uD604\uC7AC \uC2DC\uAC04)").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 100)").action(async (id, _opts, cmd) => {
|
|
6869
7070
|
const opts = cmd.optsWithGlobals();
|
|
6870
7071
|
requireNonEmpty(id, "id");
|
|
6871
7072
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -6904,7 +7105,7 @@ var logsCommand = new import_commander44.Command("logs").description("NCS worklo
|
|
|
6904
7105
|
ids: []
|
|
6905
7106
|
});
|
|
6906
7107
|
});
|
|
6907
|
-
var eventsCommand2 = new
|
|
7108
|
+
var eventsCommand2 = new import_commander46.Command("events").description("NCS workload task \uC758 \uC774\uBCA4\uD2B8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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("--from <time>", "\uC774\uBCA4\uD2B8 \uB9C8\uC9C0\uB9C9 \uBC1C\uC0DD \uC2DC\uC791 \uC2DC\uAC04 (\uAE30\uBCF8: \uD604\uC7AC\uB85C\uBD80\uD130 1\uC2DC\uAC04 \uC804)").option("--to <time>", "\uC774\uBCA4\uD2B8 \uB9C8\uC9C0\uB9C9 \uBC1C\uC0DD \uC885\uB8CC \uC2DC\uAC04 (\uAE30\uBCF8: \uD604\uC7AC \uC2DC\uAC04)").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) => {
|
|
6908
7109
|
const opts = cmd.optsWithGlobals();
|
|
6909
7110
|
requireNonEmpty(id, "id");
|
|
6910
7111
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -6940,7 +7141,7 @@ var eventsCommand2 = new import_commander44.Command("events").description("NCS w
|
|
|
6940
7141
|
ids: []
|
|
6941
7142
|
});
|
|
6942
7143
|
});
|
|
6943
|
-
var historyGetCommand = new
|
|
7144
|
+
var historyGetCommand = new import_commander46.Command("get").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, historyId, _opts, cmd) => {
|
|
6944
7145
|
const opts = cmd.optsWithGlobals();
|
|
6945
7146
|
requireNonEmpty(id, "id");
|
|
6946
7147
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -6969,7 +7170,7 @@ var historyGetCommand = new import_commander44.Command("get").description("NCS w
|
|
|
6969
7170
|
ids: [String(detail.id)]
|
|
6970
7171
|
});
|
|
6971
7172
|
});
|
|
6972
|
-
var historyCommand = new
|
|
7173
|
+
var historyCommand = new import_commander46.Command("history").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").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) => {
|
|
6973
7174
|
const opts = cmd.optsWithGlobals();
|
|
6974
7175
|
requireNonEmpty(id, "id");
|
|
6975
7176
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7002,7 +7203,7 @@ var historyCommand = new import_commander44.Command("history").description("NCS
|
|
|
7002
7203
|
ids: history.map((h) => String(h.id))
|
|
7003
7204
|
});
|
|
7004
7205
|
}).addCommand(historyGetCommand);
|
|
7005
|
-
var scheduleHistoryCommand = new
|
|
7206
|
+
var scheduleHistoryCommand = new import_commander46.Command("schedule-history").description("NCS workload \uC608\uC57D \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7006
7207
|
const opts = cmd.optsWithGlobals();
|
|
7007
7208
|
requireNonEmpty(id, "id");
|
|
7008
7209
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7023,7 +7224,7 @@ var scheduleHistoryCommand = new import_commander44.Command("schedule-history").
|
|
|
7023
7224
|
ids: scheduleHistory.map((s) => s.id)
|
|
7024
7225
|
});
|
|
7025
7226
|
});
|
|
7026
|
-
var createCommand7 = new
|
|
7227
|
+
var createCommand7 = new import_commander46.Command("create").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "workload \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--wait", "workload \uAC00 Running \uC0C1\uD0DC\uAC00 \uB420 \uB54C\uAE4C\uC9C0 \uB300\uAE30").option("--timeout <sec>", "wait \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 300)", "300").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
7027
7228
|
const opts = cmd.optsWithGlobals();
|
|
7028
7229
|
const payload = readJsonPayload(opts.file);
|
|
7029
7230
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
@@ -7054,7 +7255,7 @@ var createCommand7 = new import_commander44.Command("create").description("NCS w
|
|
|
7054
7255
|
ids: [workload.id]
|
|
7055
7256
|
});
|
|
7056
7257
|
});
|
|
7057
|
-
var updateCommand = new
|
|
7258
|
+
var updateCommand = new import_commander46.Command("update").description("NCS workload \uB97C \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, PUT)").argument("<id>", "workload ID").requiredOption("--file <path>", "workload \uAD50\uCCB4 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7058
7259
|
const opts = cmd.optsWithGlobals();
|
|
7059
7260
|
requireNonEmpty(id, "id");
|
|
7060
7261
|
const payload = readJsonPayload(opts.file);
|
|
@@ -7075,7 +7276,7 @@ var updateCommand = new import_commander44.Command("update").description("NCS wo
|
|
|
7075
7276
|
ids: [workload.id]
|
|
7076
7277
|
});
|
|
7077
7278
|
});
|
|
7078
|
-
var patchCommand = new
|
|
7279
|
+
var patchCommand = new import_commander46.Command("patch").description("NCS workload \uB97C \uBD80\uBD84 \uBCC0\uACBD\uD55C\uB2E4 (--file \uB85C JSON Patch \uBC30\uC5F4 \uC804\uB2EC, RFC 6902)").argument("<id>", "workload ID").requiredOption("--file <path>", "JSON Patch \uBC30\uC5F4(op/path/value)\uC774 \uB2F4\uAE34 \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7079
7280
|
const opts = cmd.optsWithGlobals();
|
|
7080
7281
|
requireNonEmpty(id, "id");
|
|
7081
7282
|
const payload = readJsonPayload(opts.file);
|
|
@@ -7096,7 +7297,7 @@ var patchCommand = new import_commander44.Command("patch").description("NCS work
|
|
|
7096
7297
|
ids: [workload.id]
|
|
7097
7298
|
});
|
|
7098
7299
|
});
|
|
7099
|
-
var pauseCommand = new
|
|
7300
|
+
var pauseCommand = new import_commander46.Command("pause").description("NCS workload \uB97C \uC77C\uC2DC\uC815\uC9C0\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7100
7301
|
const opts = cmd.optsWithGlobals();
|
|
7101
7302
|
requireNonEmpty(id, "id");
|
|
7102
7303
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7108,10 +7309,10 @@ var pauseCommand = new import_commander44.Command("pause").description("NCS work
|
|
|
7108
7309
|
throw err;
|
|
7109
7310
|
}
|
|
7110
7311
|
stopSpinner(true);
|
|
7111
|
-
process.stderr.write(
|
|
7312
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC77C\uC2DC\uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
7112
7313
|
`));
|
|
7113
7314
|
});
|
|
7114
|
-
var resumeCommand = new
|
|
7315
|
+
var resumeCommand = new import_commander46.Command("resume").description("NCS workload \uB97C \uC7AC\uAC1C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7115
7316
|
const opts = cmd.optsWithGlobals();
|
|
7116
7317
|
requireNonEmpty(id, "id");
|
|
7117
7318
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7123,10 +7324,10 @@ var resumeCommand = new import_commander44.Command("resume").description("NCS wo
|
|
|
7123
7324
|
throw err;
|
|
7124
7325
|
}
|
|
7125
7326
|
stopSpinner(true);
|
|
7126
|
-
process.stderr.write(
|
|
7327
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC7AC\uAC1C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
7127
7328
|
`));
|
|
7128
7329
|
});
|
|
7129
|
-
var restartCommand = new
|
|
7330
|
+
var restartCommand = new import_commander46.Command("restart").description("NCS workload task \uB97C \uC7AC\uC2DC\uC791\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").action(async (id, _opts, cmd) => {
|
|
7130
7331
|
const opts = cmd.optsWithGlobals();
|
|
7131
7332
|
requireNonEmpty(id, "id");
|
|
7132
7333
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -7145,16 +7346,16 @@ var restartCommand = new import_commander44.Command("restart").description("NCS
|
|
|
7145
7346
|
}
|
|
7146
7347
|
stopSpinner(true);
|
|
7147
7348
|
process.stderr.write(
|
|
7148
|
-
|
|
7349
|
+
import_chalk17.default.green(`\u2713 NCS workload "${id}" task "${opts.task}" \uAC00 \uC7AC\uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
7149
7350
|
`)
|
|
7150
7351
|
);
|
|
7151
7352
|
});
|
|
7152
|
-
var deleteCommand6 = new
|
|
7353
|
+
var deleteCommand6 = new import_commander46.Command("delete").description("NCS workload \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "workload ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
7153
7354
|
const opts = cmd.optsWithGlobals();
|
|
7154
7355
|
requireNonEmpty(id, "id");
|
|
7155
7356
|
const ok = await confirmDestructive(`NCS workload "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7156
7357
|
if (!ok) {
|
|
7157
|
-
process.stderr.write(
|
|
7358
|
+
process.stderr.write(import_chalk17.default.yellow("\uC0AD\uC81C\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7158
7359
|
return;
|
|
7159
7360
|
}
|
|
7160
7361
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7166,13 +7367,13 @@ var deleteCommand6 = new import_commander44.Command("delete").description("NCS w
|
|
|
7166
7367
|
throw err;
|
|
7167
7368
|
}
|
|
7168
7369
|
stopSpinner(true);
|
|
7169
|
-
process.stderr.write(
|
|
7370
|
+
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
7170
7371
|
`));
|
|
7171
7372
|
});
|
|
7172
|
-
var workloadCommand = new
|
|
7373
|
+
var workloadCommand = new import_commander46.Command("workload").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uAD00\uB9AC").addCommand(listCommand9).addCommand(getCommand7).addCommand(logsCommand).addCommand(eventsCommand2).addCommand(historyCommand).addCommand(scheduleHistoryCommand).addCommand(createCommand7).addCommand(updateCommand).addCommand(patchCommand).addCommand(pauseCommand).addCommand(resumeCommand).addCommand(restartCommand).addCommand(deleteCommand6);
|
|
7173
7374
|
|
|
7174
7375
|
// src/commands/ncs/malware.ts
|
|
7175
|
-
var
|
|
7376
|
+
var import_commander47 = require("commander");
|
|
7176
7377
|
function parseEnabledOption(value) {
|
|
7177
7378
|
if (value === "true") return true;
|
|
7178
7379
|
if (value === "false") return false;
|
|
@@ -7181,7 +7382,7 @@ function parseEnabledOption(value) {
|
|
|
7181
7382
|
EXIT_PARAM_ERROR
|
|
7182
7383
|
);
|
|
7183
7384
|
}
|
|
7184
|
-
var configGetCommand = new
|
|
7385
|
+
var configGetCommand = new import_commander47.Command("get").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
7185
7386
|
const opts = cmd.optsWithGlobals();
|
|
7186
7387
|
const { client } = await resolveNcsClient(opts);
|
|
7187
7388
|
startSpinner("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uC870\uD68C \uC911...");
|
|
@@ -7200,7 +7401,7 @@ var configGetCommand = new import_commander45.Command("get").description("NCS \u
|
|
|
7200
7401
|
ids: []
|
|
7201
7402
|
});
|
|
7202
7403
|
});
|
|
7203
|
-
var configSetCommand = new
|
|
7404
|
+
var configSetCommand = new import_commander47.Command("set").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").requiredOption("--enabled <true|false>", "\uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC0AC\uC6A9 \uC5EC\uBD80").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
7204
7405
|
const opts = cmd.optsWithGlobals();
|
|
7205
7406
|
const enabled = parseEnabledOption(opts.enabled);
|
|
7206
7407
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -7220,8 +7421,8 @@ var configSetCommand = new import_commander45.Command("set").description("NCS \u
|
|
|
7220
7421
|
ids: []
|
|
7221
7422
|
});
|
|
7222
7423
|
});
|
|
7223
|
-
var configCommand = new
|
|
7224
|
-
var resultCommand = new
|
|
7424
|
+
var configCommand = new import_commander47.Command("config").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uAD00\uB9AC").addCommand(configGetCommand).addCommand(configSetCommand);
|
|
7425
|
+
var resultCommand = new import_commander47.Command("result").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uC758 \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<workloadId>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--app-key <key>", "NCS appKey (profile \uC758 ncs.appkey \uBCF4\uB2E4 \uC6B0\uC120)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (workloadId, historyId, _opts, cmd) => {
|
|
7225
7426
|
const opts = cmd.optsWithGlobals();
|
|
7226
7427
|
requireNonEmpty(workloadId, "workloadId");
|
|
7227
7428
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -7252,7 +7453,7 @@ var resultCommand = new import_commander45.Command("result").description("NCS wo
|
|
|
7252
7453
|
ids: []
|
|
7253
7454
|
});
|
|
7254
7455
|
});
|
|
7255
|
-
var malwareCommand = new
|
|
7456
|
+
var malwareCommand = new import_commander47.Command("malware").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uAD00\uB9AC").addCommand(configCommand).addCommand(resultCommand);
|
|
7256
7457
|
|
|
7257
7458
|
// src/index.ts
|
|
7258
7459
|
var rootAgentHints = `
|
|
@@ -7313,24 +7514,24 @@ Agent workflow:
|
|
|
7313
7514
|
2. nhncloud ncs workload list --json
|
|
7314
7515
|
3. nhncloud ncs workload get <id> --json
|
|
7315
7516
|
`;
|
|
7316
|
-
var program = new
|
|
7317
|
-
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.
|
|
7517
|
+
var program = new import_commander48.Command();
|
|
7518
|
+
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.9.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").addHelpText("after", rootAgentHints);
|
|
7318
7519
|
program.hook("preAction", () => {
|
|
7319
7520
|
const opts = program.opts();
|
|
7320
7521
|
if (!opts.color || process.env["NO_COLOR"]) {
|
|
7321
|
-
|
|
7522
|
+
import_chalk18.default.level = 0;
|
|
7322
7523
|
}
|
|
7323
7524
|
if (opts.json || opts.quiet) {
|
|
7324
7525
|
setQuiet(true);
|
|
7325
7526
|
}
|
|
7326
7527
|
});
|
|
7327
7528
|
program.addCommand(configureCommand);
|
|
7328
|
-
var logncrashCommand = new
|
|
7529
|
+
var logncrashCommand = new import_commander48.Command("logncrash").description("Log & Crash \uAD00\uB828 \uBA85\uB839").addHelpText("after", logncrashAgentWorkflow);
|
|
7329
7530
|
logncrashCommand.addCommand(searchCommand);
|
|
7330
7531
|
logncrashCommand.addCommand(sendCommand);
|
|
7331
7532
|
logncrashCommand.addCommand(exportCommand);
|
|
7332
7533
|
program.addCommand(logncrashCommand);
|
|
7333
|
-
var deployCommand = new
|
|
7534
|
+
var deployCommand = new import_commander48.Command("deploy").description("NHN Cloud Deploy \uAD00\uB828 \uBA85\uB839").addHelpText("after", deployAgentWorkflow);
|
|
7334
7535
|
deployCommand.addCommand(runCommand);
|
|
7335
7536
|
deployCommand.addCommand(artifactsCommand);
|
|
7336
7537
|
deployCommand.addCommand(serverGroupsCommand);
|
|
@@ -7340,7 +7541,7 @@ deployCommand.addCommand(binariesCommand);
|
|
|
7340
7541
|
deployCommand.addCommand(uploadCommand);
|
|
7341
7542
|
deployCommand.addCommand(downloadCommand);
|
|
7342
7543
|
program.addCommand(deployCommand);
|
|
7343
|
-
var instanceCommand = new
|
|
7544
|
+
var instanceCommand = new import_commander48.Command("instance").description("Compute \uC778\uC2A4\uD134\uC2A4 \uAD00\uB828 \uBA85\uB839").addHelpText("after", instanceAgentWorkflow);
|
|
7344
7545
|
instanceCommand.addCommand(listCommand);
|
|
7345
7546
|
instanceCommand.addCommand(flavorsCommand);
|
|
7346
7547
|
instanceCommand.addCommand(availabilityZonesCommand);
|
|
@@ -7359,44 +7560,46 @@ instanceCommand.addCommand(keypairCommand);
|
|
|
7359
7560
|
instanceCommand.addCommand(volumeCommand);
|
|
7360
7561
|
instanceCommand.addCommand(volumesCommand);
|
|
7361
7562
|
program.addCommand(instanceCommand);
|
|
7362
|
-
var networkCommand = new
|
|
7563
|
+
var networkCommand = new import_commander48.Command("network").description("VPC\xB7\uC11C\uBE0C\uB137 \uC870\uD68C").addHelpText("after", networkAgentWorkflow);
|
|
7363
7564
|
networkCommand.addCommand(listCommand3);
|
|
7364
7565
|
networkCommand.addCommand(subnetCommand);
|
|
7365
7566
|
program.addCommand(networkCommand);
|
|
7366
|
-
var volumeCommand2 = new
|
|
7567
|
+
var volumeCommand2 = new import_commander48.Command("volume").description("Block Storage \uBCFC\uB968 \uAD00\uB828 \uBA85\uB839").addHelpText("after", volumeAgentWorkflow);
|
|
7367
7568
|
volumeCommand2.addCommand(listCommand2);
|
|
7368
7569
|
volumeCommand2.addCommand(getCommand);
|
|
7369
7570
|
volumeCommand2.addCommand(createCommand);
|
|
7370
7571
|
program.addCommand(volumeCommand2);
|
|
7371
|
-
var floatingipCommand = new
|
|
7572
|
+
var floatingipCommand = new import_commander48.Command("floatingip").description(
|
|
7372
7573
|
"Floating IP(\uC778\uC2A4\uD134\uC2A4 \uACF5\uC778 IP) \uAD00\uB9AC"
|
|
7373
7574
|
).addHelpText("after", floatingIpAgentWorkflow);
|
|
7374
7575
|
floatingipCommand.addCommand(listCommand4);
|
|
7375
7576
|
floatingipCommand.addCommand(createCommand2);
|
|
7376
7577
|
floatingipCommand.addCommand(deleteCommand);
|
|
7377
7578
|
program.addCommand(floatingipCommand);
|
|
7378
|
-
var ncrCommand = new
|
|
7579
|
+
var ncrCommand = new import_commander48.Command("ncr").description("NHN Container Registry \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncrAgentWorkflow);
|
|
7379
7580
|
ncrCommand.addCommand(listCommand5);
|
|
7380
7581
|
ncrCommand.addCommand(getCommand3);
|
|
7381
7582
|
ncrCommand.addCommand(imagesCommand2);
|
|
7382
7583
|
ncrCommand.addCommand(tagsCommand);
|
|
7383
7584
|
program.addCommand(ncrCommand);
|
|
7384
|
-
var nksCommand = new
|
|
7585
|
+
var nksCommand = new import_commander48.Command("nks").description("NHN Kubernetes Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", nksAgentWorkflow);
|
|
7385
7586
|
nksCommand.addCommand(supportsCommand);
|
|
7386
7587
|
nksCommand.addCommand(clusterCommand);
|
|
7387
7588
|
nksCommand.addCommand(nodegroupCommand);
|
|
7388
7589
|
nksCommand.addCommand(addonTypeCommand);
|
|
7389
7590
|
nksCommand.addCommand(addonCommand);
|
|
7390
7591
|
program.addCommand(nksCommand);
|
|
7391
|
-
var ncsCommand = new
|
|
7592
|
+
var ncsCommand = new import_commander48.Command("ncs").description("NHN Container Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncsAgentWorkflow);
|
|
7392
7593
|
ncsCommand.addCommand(templateCommand);
|
|
7393
7594
|
ncsCommand.addCommand(workloadCommand);
|
|
7394
7595
|
ncsCommand.addCommand(malwareCommand);
|
|
7395
7596
|
program.addCommand(ncsCommand);
|
|
7597
|
+
program.addCommand(skillsCommand);
|
|
7598
|
+
program.addCommand(doctorCommand);
|
|
7396
7599
|
program.addCommand(createCommandsCommand(program));
|
|
7397
7600
|
program.parseAsync().catch((err) => {
|
|
7398
7601
|
const message = err instanceof Error ? err.message : String(err);
|
|
7399
7602
|
const exitCode = err instanceof NhnCloudCliError ? err.exitCode : 1;
|
|
7400
|
-
process.stderr.write(
|
|
7603
|
+
process.stderr.write(import_chalk18.default.red(`\uC624\uB958: ${message}`) + "\n");
|
|
7401
7604
|
process.exit(exitCode);
|
|
7402
7605
|
});
|