@bifos/nhncloud-cli 0.17.0 → 0.18.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 +2 -0
- package/dist/index.js +1041 -296
- package/package.json +1 -1
- package/skills/nhncloud-cli/SKILL.md +2 -4
- package/skills/nhncloud-cli/references/apigateway.md +7 -42
- package/skills/nhncloud-cli/references/common.md +14 -84
- package/skills/nhncloud-cli/references/deploy.md +2 -39
- package/skills/nhncloud-cli/references/iaas.md +56 -9
- package/skills/nhncloud-cli/references/loadbalancer.md +0 -42
- package/skills/nhncloud-cli/references/logncrash.md +3 -48
- package/skills/nhncloud-cli/references/ncr.md +0 -22
- package/skills/nhncloud-cli/references/ncs.md +2 -42
- package/skills/nhncloud-cli/references/nks.md +0 -9
- package/skills/nhncloud-cli/references/troubleshooting.md +15 -23
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
var
|
|
27
|
+
var import_commander64 = require("commander");
|
|
28
28
|
var import_chalk18 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/utils/spinner.ts
|
|
@@ -4828,6 +4828,14 @@ var InstanceClient = class {
|
|
|
4828
4828
|
throw toNhnCloudCliError(err);
|
|
4829
4829
|
}
|
|
4830
4830
|
}
|
|
4831
|
+
/** 인스턴스에 보안그룹을 연결한다 (addSecurityGroup action, 이름 기준). */
|
|
4832
|
+
async addSecurityGroup(id, groupName) {
|
|
4833
|
+
return this.serverAction(id, { addSecurityGroup: { name: groupName } });
|
|
4834
|
+
}
|
|
4835
|
+
/** 인스턴스에서 보안그룹 연결을 해제한다 (removeSecurityGroup action, 이름 기준). */
|
|
4836
|
+
async removeSecurityGroup(id, groupName) {
|
|
4837
|
+
return this.serverAction(id, { removeSecurityGroup: { name: groupName } });
|
|
4838
|
+
}
|
|
4831
4839
|
/** 인스턴스를 시작한다 (SHUTOFF → ACTIVE). */
|
|
4832
4840
|
async start(id) {
|
|
4833
4841
|
return this.serverAction(id, { "os-start": null });
|
|
@@ -5382,8 +5390,37 @@ var createCommand = new import_commander21.Command("create").description("\uBCFC
|
|
|
5382
5390
|
// src/commands/network/list.ts
|
|
5383
5391
|
var import_commander22 = require("commander");
|
|
5384
5392
|
|
|
5393
|
+
// src/commands/network/helpers.ts
|
|
5394
|
+
var import_node_net = require("net");
|
|
5395
|
+
|
|
5396
|
+
// src/services/network/client.ts
|
|
5397
|
+
var import_ky12 = __toESM(require("ky"));
|
|
5398
|
+
|
|
5399
|
+
// src/services/network/errors.ts
|
|
5400
|
+
var import_ky11 = require("ky");
|
|
5401
|
+
var REJECTION_STATUSES = /* @__PURE__ */ new Set([400, 409]);
|
|
5402
|
+
async function toNetworkWriteError(err) {
|
|
5403
|
+
const base = toNhnCloudCliError(err);
|
|
5404
|
+
if (!(err instanceof import_ky11.HTTPError) || !REJECTION_STATUSES.has(err.response.status)) {
|
|
5405
|
+
return base;
|
|
5406
|
+
}
|
|
5407
|
+
let reason = null;
|
|
5408
|
+
try {
|
|
5409
|
+
const body = await err.response.json();
|
|
5410
|
+
const neutron = typeof body === "object" && body !== null ? body["NeutronError"] : void 0;
|
|
5411
|
+
const message = typeof neutron === "object" && neutron !== null ? neutron["message"] : void 0;
|
|
5412
|
+
if (typeof message === "string") reason = message;
|
|
5413
|
+
} catch {
|
|
5414
|
+
}
|
|
5415
|
+
if (reason === null) return base;
|
|
5416
|
+
return new NhnCloudCliError(
|
|
5417
|
+
`${base.message}
|
|
5418
|
+
\uC11C\uBC84 \uC751\uB2F5: ${sanitizeForTerminal(reason)}`,
|
|
5419
|
+
base.exitCode
|
|
5420
|
+
);
|
|
5421
|
+
}
|
|
5422
|
+
|
|
5385
5423
|
// src/services/network/client.ts
|
|
5386
|
-
var import_ky11 = __toESM(require("ky"));
|
|
5387
5424
|
function isVpc(val) {
|
|
5388
5425
|
if (typeof val !== "object" || val === null) return false;
|
|
5389
5426
|
const obj = val;
|
|
@@ -5419,6 +5456,28 @@ function isFloatingIpResponse(val) {
|
|
|
5419
5456
|
const obj = val;
|
|
5420
5457
|
return isFloatingIp(obj["floatingip"]);
|
|
5421
5458
|
}
|
|
5459
|
+
function isSecurityGroupRule(val) {
|
|
5460
|
+
if (typeof val !== "object" || val === null) return false;
|
|
5461
|
+
const obj = val;
|
|
5462
|
+
return typeof obj["id"] === "string" && typeof obj["security_group_id"] === "string" && typeof obj["direction"] === "string" && typeof obj["ethertype"] === "string" && (obj["protocol"] === null || typeof obj["protocol"] === "string") && (obj["port_range_min"] === null || typeof obj["port_range_min"] === "number") && (obj["port_range_max"] === null || typeof obj["port_range_max"] === "number") && (obj["remote_ip_prefix"] === null || typeof obj["remote_ip_prefix"] === "string") && (obj["remote_group_id"] === null || typeof obj["remote_group_id"] === "string") && (obj["description"] === null || typeof obj["description"] === "string") && typeof obj["tenant_id"] === "string";
|
|
5463
|
+
}
|
|
5464
|
+
function isSecurityGroup(val) {
|
|
5465
|
+
if (typeof val !== "object" || val === null) return false;
|
|
5466
|
+
const obj = val;
|
|
5467
|
+
return typeof obj["id"] === "string" && typeof obj["name"] === "string" && typeof obj["description"] === "string" && typeof obj["tenant_id"] === "string" && Array.isArray(obj["security_group_rules"]) && obj["security_group_rules"].every(isSecurityGroupRule);
|
|
5468
|
+
}
|
|
5469
|
+
function isSecurityGroupPort(val) {
|
|
5470
|
+
if (typeof val !== "object" || val === null) return false;
|
|
5471
|
+
const obj = val;
|
|
5472
|
+
return typeof obj["id"] === "string" && typeof obj["name"] === "string" && typeof obj["status"] === "string" && typeof obj["device_owner"] === "string" && typeof obj["device_id"] === "string" && typeof obj["network_id"] === "string" && Array.isArray(obj["fixed_ips"]) && obj["fixed_ips"].every((ip) => {
|
|
5473
|
+
if (typeof ip !== "object" || ip === null) return false;
|
|
5474
|
+
const fixedIp = ip;
|
|
5475
|
+
return typeof fixedIp["subnet_id"] === "string" && typeof fixedIp["ip_address"] === "string";
|
|
5476
|
+
}) && Array.isArray(obj["security_groups"]) && obj["security_groups"].every((id) => typeof id === "string");
|
|
5477
|
+
}
|
|
5478
|
+
function omitUndefined(obj) {
|
|
5479
|
+
return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
|
|
5480
|
+
}
|
|
5422
5481
|
var NetworkClient = class {
|
|
5423
5482
|
tokenId;
|
|
5424
5483
|
networkEndpoint;
|
|
@@ -5429,6 +5488,184 @@ var NetworkClient = class {
|
|
|
5429
5488
|
authHeaders() {
|
|
5430
5489
|
return { "X-Auth-Token": this.tokenId };
|
|
5431
5490
|
}
|
|
5491
|
+
async listSecurityGroups() {
|
|
5492
|
+
try {
|
|
5493
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-groups`, {
|
|
5494
|
+
headers: this.authHeaders(),
|
|
5495
|
+
retry: 0,
|
|
5496
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5497
|
+
}).json();
|
|
5498
|
+
const groups = typeof raw === "object" && raw !== null ? raw["security_groups"] : void 0;
|
|
5499
|
+
if (!Array.isArray(groups) || !groups.every(isSecurityGroup)) {
|
|
5500
|
+
throw new NhnCloudCliError("network security-group list \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_groups \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5501
|
+
}
|
|
5502
|
+
return groups;
|
|
5503
|
+
} catch (err) {
|
|
5504
|
+
throw toNhnCloudCliError(err);
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
async getSecurityGroup(id) {
|
|
5508
|
+
try {
|
|
5509
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-groups/${encodeURIComponent(id)}`, {
|
|
5510
|
+
headers: this.authHeaders(),
|
|
5511
|
+
retry: 0,
|
|
5512
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5513
|
+
}).json();
|
|
5514
|
+
const group = typeof raw === "object" && raw !== null ? raw["security_group"] : void 0;
|
|
5515
|
+
if (!isSecurityGroup(group)) {
|
|
5516
|
+
throw new NhnCloudCliError("network security-group get \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5517
|
+
}
|
|
5518
|
+
return group;
|
|
5519
|
+
} catch (err) {
|
|
5520
|
+
throw toNhnCloudCliError(err);
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5523
|
+
async listSecurityGroupRules(securityGroupId) {
|
|
5524
|
+
try {
|
|
5525
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-group-rules`, {
|
|
5526
|
+
headers: this.authHeaders(),
|
|
5527
|
+
searchParams: { security_group_id: securityGroupId },
|
|
5528
|
+
retry: 0,
|
|
5529
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5530
|
+
}).json();
|
|
5531
|
+
const rules = typeof raw === "object" && raw !== null ? raw["security_group_rules"] : void 0;
|
|
5532
|
+
if (!Array.isArray(rules) || !rules.every(isSecurityGroupRule)) {
|
|
5533
|
+
throw new NhnCloudCliError("network security-group rule list \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group_rules \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5534
|
+
}
|
|
5535
|
+
return rules;
|
|
5536
|
+
} catch (err) {
|
|
5537
|
+
throw toNhnCloudCliError(err);
|
|
5538
|
+
}
|
|
5539
|
+
}
|
|
5540
|
+
async getSecurityGroupRule(id) {
|
|
5541
|
+
try {
|
|
5542
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-group-rules/${encodeURIComponent(id)}`, {
|
|
5543
|
+
headers: this.authHeaders(),
|
|
5544
|
+
retry: 0,
|
|
5545
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5546
|
+
}).json();
|
|
5547
|
+
const rule = typeof raw === "object" && raw !== null ? raw["security_group_rule"] : void 0;
|
|
5548
|
+
if (!isSecurityGroupRule(rule)) {
|
|
5549
|
+
throw new NhnCloudCliError("network security-group rule get \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group_rule \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5550
|
+
}
|
|
5551
|
+
return rule;
|
|
5552
|
+
} catch (err) {
|
|
5553
|
+
throw toNhnCloudCliError(err);
|
|
5554
|
+
}
|
|
5555
|
+
}
|
|
5556
|
+
async listSecurityGroupPorts(securityGroupId) {
|
|
5557
|
+
try {
|
|
5558
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-group-ports`, {
|
|
5559
|
+
headers: this.authHeaders(),
|
|
5560
|
+
searchParams: { security_group_id: securityGroupId },
|
|
5561
|
+
retry: 0,
|
|
5562
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5563
|
+
}).json();
|
|
5564
|
+
const ports = typeof raw === "object" && raw !== null ? raw["security_group_ports"] : void 0;
|
|
5565
|
+
if (!Array.isArray(ports) || !ports.every(isSecurityGroupPort)) {
|
|
5566
|
+
throw new NhnCloudCliError("network security-group ports \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group_ports \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5567
|
+
}
|
|
5568
|
+
return ports;
|
|
5569
|
+
} catch (err) {
|
|
5570
|
+
throw toNhnCloudCliError(err);
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
/** 보안그룹을 생성한다 (POST /v2.0/security-groups). 송신 규칙 두 개가 자동으로 함께 생성된다. */
|
|
5574
|
+
async createSecurityGroup(params) {
|
|
5575
|
+
try {
|
|
5576
|
+
const raw = await import_ky12.default.post(`${this.networkEndpoint}/security-groups`, {
|
|
5577
|
+
headers: this.authHeaders(),
|
|
5578
|
+
json: { security_group: omitUndefined(params) },
|
|
5579
|
+
retry: 0,
|
|
5580
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5581
|
+
}).json();
|
|
5582
|
+
const group = typeof raw === "object" && raw !== null ? raw["security_group"] : void 0;
|
|
5583
|
+
if (!isSecurityGroup(group)) {
|
|
5584
|
+
throw new NhnCloudCliError("network security-group create \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5585
|
+
}
|
|
5586
|
+
return group;
|
|
5587
|
+
} catch (err) {
|
|
5588
|
+
throw await toNetworkWriteError(err);
|
|
5589
|
+
}
|
|
5590
|
+
}
|
|
5591
|
+
/** 보안그룹 이름·설명을 변경한다 (PUT /v2.0/security-groups/{id}). */
|
|
5592
|
+
async updateSecurityGroup(id, params) {
|
|
5593
|
+
try {
|
|
5594
|
+
const raw = await import_ky12.default.put(`${this.networkEndpoint}/security-groups/${encodeURIComponent(id)}`, {
|
|
5595
|
+
headers: this.authHeaders(),
|
|
5596
|
+
json: { security_group: omitUndefined(params) },
|
|
5597
|
+
retry: 0,
|
|
5598
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5599
|
+
}).json();
|
|
5600
|
+
const group = typeof raw === "object" && raw !== null ? raw["security_group"] : void 0;
|
|
5601
|
+
if (!isSecurityGroup(group)) {
|
|
5602
|
+
throw new NhnCloudCliError("network security-group update \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5603
|
+
}
|
|
5604
|
+
return group;
|
|
5605
|
+
} catch (err) {
|
|
5606
|
+
throw await toNetworkWriteError(err);
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
/** 보안그룹을 삭제한다 (DELETE /v2.0/security-groups/{id}, 204 무본문). */
|
|
5610
|
+
async deleteSecurityGroup(id) {
|
|
5611
|
+
try {
|
|
5612
|
+
await import_ky12.default.delete(`${this.networkEndpoint}/security-groups/${encodeURIComponent(id)}`, {
|
|
5613
|
+
headers: this.authHeaders(),
|
|
5614
|
+
retry: 0,
|
|
5615
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5616
|
+
});
|
|
5617
|
+
} catch (err) {
|
|
5618
|
+
throw await toNetworkWriteError(err);
|
|
5619
|
+
}
|
|
5620
|
+
}
|
|
5621
|
+
/** 보안그룹 규칙을 생성한다 (POST /v2.0/security-group-rules). ethertype 은 IPv4 로 고정한다. */
|
|
5622
|
+
async createSecurityGroupRule(params) {
|
|
5623
|
+
try {
|
|
5624
|
+
const raw = await import_ky12.default.post(`${this.networkEndpoint}/security-group-rules`, {
|
|
5625
|
+
headers: this.authHeaders(),
|
|
5626
|
+
json: { security_group_rule: { ...omitUndefined(params), ethertype: "IPv4" } },
|
|
5627
|
+
retry: 0,
|
|
5628
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5629
|
+
}).json();
|
|
5630
|
+
const rule = typeof raw === "object" && raw !== null ? raw["security_group_rule"] : void 0;
|
|
5631
|
+
if (!isSecurityGroupRule(rule)) {
|
|
5632
|
+
throw new NhnCloudCliError("network security-group rule create \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group_rule \uAC1D\uCCB4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5633
|
+
}
|
|
5634
|
+
return rule;
|
|
5635
|
+
} catch (err) {
|
|
5636
|
+
throw await toNetworkWriteError(err);
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
/** 보안그룹 규칙을 삭제한다 (DELETE /v2.0/security-group-rules/{id}, 204 무본문). */
|
|
5640
|
+
async deleteSecurityGroupRule(id) {
|
|
5641
|
+
try {
|
|
5642
|
+
await import_ky12.default.delete(`${this.networkEndpoint}/security-group-rules/${encodeURIComponent(id)}`, {
|
|
5643
|
+
headers: this.authHeaders(),
|
|
5644
|
+
retry: 0,
|
|
5645
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5646
|
+
});
|
|
5647
|
+
} catch (err) {
|
|
5648
|
+
throw await toNetworkWriteError(err);
|
|
5649
|
+
}
|
|
5650
|
+
}
|
|
5651
|
+
/** 다른 보안그룹을 원격 그룹으로 참조하는 규칙을 조회한다 (GET /v2.0/security-group-rules?remote_group_id=). */
|
|
5652
|
+
async listSecurityGroupRulesByRemoteGroup(remoteGroupId) {
|
|
5653
|
+
try {
|
|
5654
|
+
const raw = await import_ky12.default.get(`${this.networkEndpoint}/security-group-rules`, {
|
|
5655
|
+
headers: this.authHeaders(),
|
|
5656
|
+
searchParams: { remote_group_id: remoteGroupId },
|
|
5657
|
+
retry: 0,
|
|
5658
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
5659
|
+
}).json();
|
|
5660
|
+
const rules = typeof raw === "object" && raw !== null ? raw["security_group_rules"] : void 0;
|
|
5661
|
+
if (!Array.isArray(rules) || !rules.every(isSecurityGroupRule)) {
|
|
5662
|
+
throw new NhnCloudCliError("network security-group rule list \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 security_group_rules \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
5663
|
+
}
|
|
5664
|
+
return rules;
|
|
5665
|
+
} catch (err) {
|
|
5666
|
+
throw toNhnCloudCliError(err);
|
|
5667
|
+
}
|
|
5668
|
+
}
|
|
5432
5669
|
/**
|
|
5433
5670
|
* VPC 목록을 조회한다 (GET /v2.0/vpcs, NHN VPC).
|
|
5434
5671
|
* instance 와 다른 host(networkEndpoint)지만 같은 Keystone 토큰을 쓴다.
|
|
@@ -5436,7 +5673,7 @@ var NetworkClient = class {
|
|
|
5436
5673
|
async listVpcs() {
|
|
5437
5674
|
const url = `${this.networkEndpoint}/vpcs`;
|
|
5438
5675
|
try {
|
|
5439
|
-
const raw = await
|
|
5676
|
+
const raw = await import_ky12.default.get(url, {
|
|
5440
5677
|
headers: this.authHeaders(),
|
|
5441
5678
|
retry: 0,
|
|
5442
5679
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -5458,7 +5695,7 @@ var NetworkClient = class {
|
|
|
5458
5695
|
async listSubnets() {
|
|
5459
5696
|
const url = `${this.networkEndpoint}/vpcsubnets`;
|
|
5460
5697
|
try {
|
|
5461
|
-
const raw = await
|
|
5698
|
+
const raw = await import_ky12.default.get(url, {
|
|
5462
5699
|
headers: this.authHeaders(),
|
|
5463
5700
|
retry: 0,
|
|
5464
5701
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -5478,7 +5715,7 @@ var NetworkClient = class {
|
|
|
5478
5715
|
async listFloatingIps() {
|
|
5479
5716
|
const url = `${this.networkEndpoint}/floatingips`;
|
|
5480
5717
|
try {
|
|
5481
|
-
const raw = await
|
|
5718
|
+
const raw = await import_ky12.default.get(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS }).json();
|
|
5482
5719
|
if (!isFloatingIpsResponse(raw)) {
|
|
5483
5720
|
throw new NhnCloudCliError(
|
|
5484
5721
|
"floatingip list \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 floatingips \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -5494,7 +5731,7 @@ var NetworkClient = class {
|
|
|
5494
5731
|
async createFloatingIp(params) {
|
|
5495
5732
|
const url = `${this.networkEndpoint}/floatingips`;
|
|
5496
5733
|
try {
|
|
5497
|
-
const raw = await
|
|
5734
|
+
const raw = await import_ky12.default.post(url, {
|
|
5498
5735
|
headers: this.authHeaders(),
|
|
5499
5736
|
json: { floatingip: { floating_network_id: params.floating_network_id } },
|
|
5500
5737
|
retry: 0,
|
|
@@ -5515,7 +5752,7 @@ var NetworkClient = class {
|
|
|
5515
5752
|
async deleteFloatingIp(id) {
|
|
5516
5753
|
const url = `${this.networkEndpoint}/floatingips/${encodeURIComponent(id)}`;
|
|
5517
5754
|
try {
|
|
5518
|
-
await
|
|
5755
|
+
await import_ky12.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
5519
5756
|
} catch (err) {
|
|
5520
5757
|
throw toNhnCloudCliError(err);
|
|
5521
5758
|
}
|
|
@@ -5529,7 +5766,7 @@ var NetworkClient = class {
|
|
|
5529
5766
|
async findExternalNetworkId() {
|
|
5530
5767
|
const url = `${this.networkEndpoint}/vpcs`;
|
|
5531
5768
|
try {
|
|
5532
|
-
const raw = await
|
|
5769
|
+
const raw = await import_ky12.default.get(url, {
|
|
5533
5770
|
headers: this.authHeaders(),
|
|
5534
5771
|
searchParams: { "router:external": "true" },
|
|
5535
5772
|
retry: 0,
|
|
@@ -5552,11 +5789,160 @@ var NetworkClient = class {
|
|
|
5552
5789
|
}
|
|
5553
5790
|
};
|
|
5554
5791
|
|
|
5792
|
+
// src/commands/resource-resolver.ts
|
|
5793
|
+
function requireResourceInput(value, label) {
|
|
5794
|
+
const normalized = value.trim();
|
|
5795
|
+
if (!normalized) {
|
|
5796
|
+
throw new NhnCloudCliError(`${label} \uC774\uB984 \uB610\uB294 UUID\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
5797
|
+
}
|
|
5798
|
+
return normalized;
|
|
5799
|
+
}
|
|
5800
|
+
function requireYes(yes, operation) {
|
|
5801
|
+
if (!yes) {
|
|
5802
|
+
throw new NhnCloudCliError(
|
|
5803
|
+
`${operation}\uC5D0\uB294 --yes \uD50C\uB798\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`,
|
|
5804
|
+
EXIT_PARAM_ERROR
|
|
5805
|
+
);
|
|
5806
|
+
}
|
|
5807
|
+
return true;
|
|
5808
|
+
}
|
|
5809
|
+
function resolvedId(resource, label) {
|
|
5810
|
+
const id = resource.id.trim();
|
|
5811
|
+
if (!id) {
|
|
5812
|
+
throw new NhnCloudCliError(`${label} \uC870\uD68C \uACB0\uACFC\uC758 UUID\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
5813
|
+
}
|
|
5814
|
+
return id;
|
|
5815
|
+
}
|
|
5816
|
+
function resolveFromList(resources, input, label) {
|
|
5817
|
+
const exactId = resources.find((resource) => resource.id === input);
|
|
5818
|
+
if (exactId) return resolvedId(exactId, label);
|
|
5819
|
+
const nameMatches = resources.filter((resource) => resource.name === input);
|
|
5820
|
+
if (nameMatches.length === 1) return resolvedId(nameMatches[0], label);
|
|
5821
|
+
if (nameMatches.length === 0) {
|
|
5822
|
+
throw new NhnCloudCliError(
|
|
5823
|
+
`${label}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${JSON.stringify(input)}`,
|
|
5824
|
+
EXIT_PARAM_ERROR
|
|
5825
|
+
);
|
|
5826
|
+
}
|
|
5827
|
+
const candidateIds = nameMatches.map((resource) => resolvedId(resource, label)).sort();
|
|
5828
|
+
throw new NhnCloudCliError(
|
|
5829
|
+
`${label} \uC774\uB984\uC774 \uC911\uBCF5\uB429\uB2C8\uB2E4: ${JSON.stringify(input)} (\uD6C4\uBCF4 UUID: ${candidateIds.join(", ")})`,
|
|
5830
|
+
EXIT_PARAM_ERROR
|
|
5831
|
+
);
|
|
5832
|
+
}
|
|
5833
|
+
|
|
5555
5834
|
// src/commands/network/helpers.ts
|
|
5556
5835
|
async function resolveNetworkClient(opts) {
|
|
5557
5836
|
const { profileName, tokenId, networkEndpoint } = await resolveIaasTokenContext(opts);
|
|
5558
5837
|
return { client: new NetworkClient(tokenId, networkEndpoint), profileName };
|
|
5559
5838
|
}
|
|
5839
|
+
async function resolveSecurityGroupClients(opts) {
|
|
5840
|
+
const { profileName, tokenId, networkEndpoint, computeEndpoint, imageEndpoint } = await resolveIaasTokenContext(opts);
|
|
5841
|
+
return {
|
|
5842
|
+
network: new NetworkClient(tokenId, networkEndpoint),
|
|
5843
|
+
instance: new InstanceClient(tokenId, computeEndpoint, imageEndpoint),
|
|
5844
|
+
profileName
|
|
5845
|
+
};
|
|
5846
|
+
}
|
|
5847
|
+
async function resolveSecurityGroupId(client, value) {
|
|
5848
|
+
const input = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
5849
|
+
return resolveFromList(await client.listSecurityGroups(), input, "\uBCF4\uC548\uADF8\uB8F9");
|
|
5850
|
+
}
|
|
5851
|
+
function requireUniqueGroupName(groups, groupId) {
|
|
5852
|
+
const group = groups.find((candidate) => candidate.id === groupId);
|
|
5853
|
+
if (!group) paramError(`\uBCF4\uC548\uADF8\uB8F9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${JSON.stringify(groupId)}`);
|
|
5854
|
+
const sameName = groups.filter((candidate) => candidate.name === group.name);
|
|
5855
|
+
if (sameName.length > 1) {
|
|
5856
|
+
const candidateIds = sameName.map((candidate) => candidate.id).sort();
|
|
5857
|
+
paramError(
|
|
5858
|
+
`\uC774\uB984\uC774 \uAC19\uC740 \uBCF4\uC548\uADF8\uB8F9\uC774 ${sameName.length}\uAC1C \uC788\uC5B4 \uC778\uC2A4\uD134\uC2A4 \uC5F0\uACB0\uC744 \uBCC0\uACBD\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${group.name} (\uD6C4\uBCF4 UUID: ${candidateIds.join(", ")}). network security-group update\uB85C \uC774\uB984\uC744 \uBA3C\uC800 \uBC14\uAFB8\uC138\uC694.`
|
|
5859
|
+
);
|
|
5860
|
+
}
|
|
5861
|
+
return group;
|
|
5862
|
+
}
|
|
5863
|
+
function formatRulePorts(rule) {
|
|
5864
|
+
if (rule.port_range_min === null && rule.port_range_max === null) return "any";
|
|
5865
|
+
if (rule.port_range_min === rule.port_range_max) return String(rule.port_range_min);
|
|
5866
|
+
return `${rule.port_range_min ?? "any"}-${rule.port_range_max ?? "any"}`;
|
|
5867
|
+
}
|
|
5868
|
+
function formatRuleRemote(rule) {
|
|
5869
|
+
if (rule.remote_ip_prefix !== null) return rule.remote_ip_prefix;
|
|
5870
|
+
if (rule.remote_group_id !== null) return `sg:${rule.remote_group_id}`;
|
|
5871
|
+
return "any";
|
|
5872
|
+
}
|
|
5873
|
+
function withOptions(command) {
|
|
5874
|
+
return command.option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
5875
|
+
}
|
|
5876
|
+
var RULE_PROTOCOLS = ["tcp", "udp", "icmp", "any"];
|
|
5877
|
+
var PORT_RANGE = { min: 1, max: 65535 };
|
|
5878
|
+
var CIDR_PREFIX_PATTERN = /^(\d|[12]\d|3[0-2])$/;
|
|
5879
|
+
function paramError(message) {
|
|
5880
|
+
throw new NhnCloudCliError(message, EXIT_PARAM_ERROR);
|
|
5881
|
+
}
|
|
5882
|
+
function parsePortRange(value) {
|
|
5883
|
+
const formatError = `--port-range\uB294 \uC2DC\uC791-\uB05D \uD615\uC2DD\uC774\uBA70 \uC2DC\uC791\uC774 \uB05D\uBCF4\uB2E4 \uD074 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${JSON.stringify(value)}`;
|
|
5884
|
+
const parts = value.split("-");
|
|
5885
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) paramError(formatError);
|
|
5886
|
+
const min = parseIntegerOption(parts[0], "--port-range", PORT_RANGE);
|
|
5887
|
+
const max = parseIntegerOption(parts[1], "--port-range", PORT_RANGE);
|
|
5888
|
+
if (min > max) paramError(formatError);
|
|
5889
|
+
return [min, max];
|
|
5890
|
+
}
|
|
5891
|
+
function isIpv4OrCidr(value) {
|
|
5892
|
+
const parts = value.split("/");
|
|
5893
|
+
if (parts.length > 2 || (0, import_node_net.isIP)(parts[0] ?? "") !== 4) return false;
|
|
5894
|
+
return parts.length === 1 || CIDR_PREFIX_PATTERN.test(parts[1] ?? "");
|
|
5895
|
+
}
|
|
5896
|
+
function parseRuleInput(opts) {
|
|
5897
|
+
const { direction, protocol } = opts;
|
|
5898
|
+
if (direction !== "ingress" && direction !== "egress") {
|
|
5899
|
+
paramError(`--direction\uC740 ingress \uB610\uB294 egress\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(direction)}`);
|
|
5900
|
+
}
|
|
5901
|
+
if (protocol !== void 0 && !RULE_PROTOCOLS.includes(protocol)) {
|
|
5902
|
+
paramError(`--protocol\uC740 tcp, udp, icmp, any \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(protocol)}`);
|
|
5903
|
+
}
|
|
5904
|
+
if (opts.port !== void 0 && opts.portRange !== void 0) {
|
|
5905
|
+
paramError("--port\uC640 --port-range\uB294 \uD568\uAED8 \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
5906
|
+
}
|
|
5907
|
+
let portRangeMin;
|
|
5908
|
+
let portRangeMax;
|
|
5909
|
+
if (opts.port !== void 0 || opts.portRange !== void 0) {
|
|
5910
|
+
if (protocol !== "tcp" && protocol !== "udp") {
|
|
5911
|
+
paramError("\uD3EC\uD2B8\uB294 --protocol tcp \uB610\uB294 udp\uC640 \uD568\uAED8 \uC9C0\uC815\uD569\uB2C8\uB2E4.");
|
|
5912
|
+
}
|
|
5913
|
+
if (opts.port !== void 0) {
|
|
5914
|
+
portRangeMin = parseIntegerOption(opts.port, "--port", PORT_RANGE);
|
|
5915
|
+
portRangeMax = portRangeMin;
|
|
5916
|
+
} else if (opts.portRange !== void 0) {
|
|
5917
|
+
[portRangeMin, portRangeMax] = parsePortRange(opts.portRange);
|
|
5918
|
+
}
|
|
5919
|
+
}
|
|
5920
|
+
if (opts.cidr !== void 0 && opts.remoteGroup !== void 0) {
|
|
5921
|
+
paramError("--cidr\uC640 --remote-group\uC740 \uD568\uAED8 \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
5922
|
+
}
|
|
5923
|
+
if (opts.cidr !== void 0 && !isIpv4OrCidr(opts.cidr)) {
|
|
5924
|
+
paramError(`--cidr\uB294 IPv4 \uC8FC\uC18C \uB610\uB294 CIDR\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(opts.cidr)}`);
|
|
5925
|
+
}
|
|
5926
|
+
return {
|
|
5927
|
+
direction,
|
|
5928
|
+
protocol,
|
|
5929
|
+
portRangeMin,
|
|
5930
|
+
portRangeMax,
|
|
5931
|
+
cidr: opts.cidr,
|
|
5932
|
+
remoteGroup: opts.remoteGroup,
|
|
5933
|
+
description: opts.description
|
|
5934
|
+
};
|
|
5935
|
+
}
|
|
5936
|
+
function toCreateRuleParams(input, securityGroupId, remoteGroupId) {
|
|
5937
|
+
const params = { security_group_id: securityGroupId, direction: input.direction };
|
|
5938
|
+
if (input.protocol !== void 0 && input.protocol !== "any") params.protocol = input.protocol;
|
|
5939
|
+
if (input.portRangeMin !== void 0) params.port_range_min = input.portRangeMin;
|
|
5940
|
+
if (input.portRangeMax !== void 0) params.port_range_max = input.portRangeMax;
|
|
5941
|
+
if (input.cidr !== void 0) params.remote_ip_prefix = input.cidr;
|
|
5942
|
+
if (remoteGroupId !== void 0) params.remote_group_id = remoteGroupId;
|
|
5943
|
+
if (input.description !== void 0) params.description = input.description;
|
|
5944
|
+
return params;
|
|
5945
|
+
}
|
|
5560
5946
|
|
|
5561
5947
|
// src/commands/network/list.ts
|
|
5562
5948
|
var listCommand3 = new import_commander22.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) => {
|
|
@@ -5608,9 +5994,324 @@ var subnetListCommand = new import_commander23.Command("list").description("\uC1
|
|
|
5608
5994
|
});
|
|
5609
5995
|
var subnetCommand = new import_commander23.Command("subnet").description("\uC11C\uBE0C\uB137 \uAD00\uB828 \uBA85\uB839").addCommand(subnetListCommand);
|
|
5610
5996
|
|
|
5611
|
-
// src/commands/
|
|
5997
|
+
// src/commands/network/security-group.ts
|
|
5998
|
+
var import_commander26 = require("commander");
|
|
5999
|
+
|
|
6000
|
+
// src/commands/network/security-group-manage.ts
|
|
5612
6001
|
var import_commander24 = require("commander");
|
|
5613
|
-
|
|
6002
|
+
function parseName(value) {
|
|
6003
|
+
const name = value.trim();
|
|
6004
|
+
if (!name) throw new NhnCloudCliError("--name\uC740 \uBE44\uC5B4 \uC788\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
6005
|
+
return name;
|
|
6006
|
+
}
|
|
6007
|
+
function outputGroup(opts, group) {
|
|
6008
|
+
output(opts, {
|
|
6009
|
+
headers: ["field", "value"],
|
|
6010
|
+
rows: [
|
|
6011
|
+
["id", group.id],
|
|
6012
|
+
["name", group.name],
|
|
6013
|
+
["description", group.description],
|
|
6014
|
+
["rules", String(group.security_group_rules.length)]
|
|
6015
|
+
],
|
|
6016
|
+
raw: group,
|
|
6017
|
+
ids: [group.id]
|
|
6018
|
+
});
|
|
6019
|
+
}
|
|
6020
|
+
var createCommand2 = withOptions(new import_commander24.Command("create").description("\uBCF4\uC548\uADF8\uB8F9\uC744 \uC0DD\uC131\uD55C\uB2E4 (\uC1A1\uC2E0 \uADDC\uCE59 \uB450 \uAC1C\uAC00 \uD568\uAED8 \uC0DD\uC131\uB41C\uB2E4)").requiredOption("--name <name>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984").option("--description <text>", "\uBCF4\uC548\uADF8\uB8F9 \uC124\uBA85")).action(async (_opts, cmd) => {
|
|
6021
|
+
const opts = cmd.optsWithGlobals();
|
|
6022
|
+
const params = { name: parseName(opts.name ?? ""), description: opts.description };
|
|
6023
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6024
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uC0DD\uC131 \uC911...");
|
|
6025
|
+
let group;
|
|
6026
|
+
try {
|
|
6027
|
+
group = await network.createSecurityGroup(params);
|
|
6028
|
+
} catch (err) {
|
|
6029
|
+
stopSpinner(false);
|
|
6030
|
+
throw err;
|
|
6031
|
+
}
|
|
6032
|
+
stopSpinner(true);
|
|
6033
|
+
outputGroup(opts, group);
|
|
6034
|
+
});
|
|
6035
|
+
var updateCommand = withOptions(new import_commander24.Command("update").description("\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984\uC774\uB098 \uC124\uBA85\uC744 \uBCC0\uACBD\uD55C\uB2E4").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--name <name>", "\uC0C8 \uC774\uB984").option("--description <text>", "\uC0C8 \uC124\uBA85")).action(async (value, _opts, cmd) => {
|
|
6036
|
+
const opts = cmd.optsWithGlobals();
|
|
6037
|
+
if (opts.name === void 0 && opts.description === void 0) {
|
|
6038
|
+
throw new NhnCloudCliError("--name \uB610\uB294 --description \uC911 \uD558\uB098\uB294 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
6039
|
+
}
|
|
6040
|
+
const params = {
|
|
6041
|
+
name: opts.name === void 0 ? void 0 : parseName(opts.name),
|
|
6042
|
+
description: opts.description
|
|
6043
|
+
};
|
|
6044
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6045
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6046
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uBCC0\uACBD \uC911...");
|
|
6047
|
+
let group;
|
|
6048
|
+
try {
|
|
6049
|
+
const id = await resolveSecurityGroupId(network, groupInput);
|
|
6050
|
+
group = await network.updateSecurityGroup(id, params);
|
|
6051
|
+
} catch (err) {
|
|
6052
|
+
stopSpinner(false);
|
|
6053
|
+
throw err;
|
|
6054
|
+
}
|
|
6055
|
+
stopSpinner(true);
|
|
6056
|
+
outputGroup(opts, group);
|
|
6057
|
+
});
|
|
6058
|
+
var deleteCommand = withOptions(new import_commander24.Command("delete").description("\uBCF4\uC548\uADF8\uB8F9\uC744 \uC0AD\uC81C\uD55C\uB2E4 (\uD3EC\uD2B8\uC5D0 \uC5F0\uACB0\uB41C \uADF8\uB8F9\uC740 \uAC70\uBD80\uD55C\uB2E4)").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--yes", "\uC0AD\uC81C \uD655\uC778")).action(async (value, _opts, cmd) => {
|
|
6059
|
+
const opts = cmd.optsWithGlobals();
|
|
6060
|
+
requireYes(opts.yes, "\uBCF4\uC548\uADF8\uB8F9 \uC0AD\uC81C");
|
|
6061
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6062
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6063
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uC0AD\uC81C \uC911...");
|
|
6064
|
+
let groupId;
|
|
6065
|
+
let referencingRules;
|
|
6066
|
+
let referenceCheckFailed = false;
|
|
6067
|
+
try {
|
|
6068
|
+
groupId = await resolveSecurityGroupId(network, groupInput);
|
|
6069
|
+
const ports = await network.listSecurityGroupPorts(groupId);
|
|
6070
|
+
if (ports.length > 0) {
|
|
6071
|
+
const deviceIds = [...new Set(ports.map((port) => port.device_id).filter((deviceId) => deviceId !== ""))];
|
|
6072
|
+
throw new NhnCloudCliError(
|
|
6073
|
+
`\uBCF4\uC548\uADF8\uB8F9\uC774 \uD3EC\uD2B8 ${ports.length}\uAC1C\uC5D0 \uC5F0\uACB0\uB418\uC5B4 \uC788\uC5B4 \uC0AD\uC81C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 instance security-group remove\uB85C \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC138\uC694: ${deviceIds.join(", ")}`,
|
|
6074
|
+
EXIT_PARAM_ERROR
|
|
6075
|
+
);
|
|
6076
|
+
}
|
|
6077
|
+
try {
|
|
6078
|
+
referencingRules = (await network.listSecurityGroupRulesByRemoteGroup(groupId)).filter(
|
|
6079
|
+
(rule) => rule.remote_group_id === groupId && rule.security_group_id !== groupId
|
|
6080
|
+
);
|
|
6081
|
+
} catch {
|
|
6082
|
+
referencingRules = [];
|
|
6083
|
+
referenceCheckFailed = true;
|
|
6084
|
+
}
|
|
6085
|
+
await network.deleteSecurityGroup(groupId);
|
|
6086
|
+
} catch (err) {
|
|
6087
|
+
stopSpinner(false);
|
|
6088
|
+
throw err;
|
|
6089
|
+
}
|
|
6090
|
+
stopSpinner(true);
|
|
6091
|
+
if (referenceCheckFailed) {
|
|
6092
|
+
process.stderr.write("\uACBD\uACE0: \uB2E4\uB978 \uBCF4\uC548\uADF8\uB8F9 \uADDC\uCE59\uC758 \uC6D0\uACA9 \uADF8\uB8F9 \uCC38\uC870\uB97C \uD655\uC778\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uC0AD\uC81C\uB294 \uC9C4\uD589\uD588\uC2B5\uB2C8\uB2E4.\n");
|
|
6093
|
+
}
|
|
6094
|
+
if (referencingRules.length > 0) {
|
|
6095
|
+
const refs = referencingRules.map((rule) => sanitizeForTerminal(`${rule.security_group_id}/${rule.id}`));
|
|
6096
|
+
process.stderr.write(
|
|
6097
|
+
`\uACBD\uACE0: \uB2E4\uB978 \uBCF4\uC548\uADF8\uB8F9 \uADDC\uCE59 ${referencingRules.length}\uAC1C\uAC00 \uC774 \uADF8\uB8F9\uC744 \uC6D0\uACA9 \uADF8\uB8F9\uC73C\uB85C \uCC38\uC870\uD588\uC2B5\uB2C8\uB2E4: ${refs.join(", ")}
|
|
6098
|
+
`
|
|
6099
|
+
);
|
|
6100
|
+
}
|
|
6101
|
+
const result = { operation: "security-group-delete", status: "succeeded", security_group_id: groupId };
|
|
6102
|
+
output(opts, {
|
|
6103
|
+
headers: ["field", "value"],
|
|
6104
|
+
rows: Object.entries(result).map(([key, field]) => [key, field]),
|
|
6105
|
+
raw: result,
|
|
6106
|
+
ids: [groupId]
|
|
6107
|
+
});
|
|
6108
|
+
});
|
|
6109
|
+
|
|
6110
|
+
// src/commands/network/security-group-rule.ts
|
|
6111
|
+
var import_commander25 = require("commander");
|
|
6112
|
+
var REPLACE_NOTE = "(\uADDC\uCE59 \uC218\uC815 API\uAC00 \uC5C6\uC5B4 \uAD50\uCCB4\uB294 \uC0DD\uC131 \uD6C4 \uC0AD\uC81C\uB85C \uD55C\uB2E4)";
|
|
6113
|
+
function outputRule(opts, rule) {
|
|
6114
|
+
output(opts, {
|
|
6115
|
+
headers: ["field", "value"],
|
|
6116
|
+
rows: [
|
|
6117
|
+
["id", rule.id],
|
|
6118
|
+
["security_group_id", rule.security_group_id],
|
|
6119
|
+
["direction", rule.direction],
|
|
6120
|
+
["ethertype", rule.ethertype],
|
|
6121
|
+
["protocol", rule.protocol ?? "any"],
|
|
6122
|
+
["ports", formatRulePorts(rule)],
|
|
6123
|
+
["remote", formatRuleRemote(rule)],
|
|
6124
|
+
["description", rule.description ?? ""]
|
|
6125
|
+
],
|
|
6126
|
+
raw: rule,
|
|
6127
|
+
ids: [rule.id]
|
|
6128
|
+
});
|
|
6129
|
+
}
|
|
6130
|
+
var listCommand4 = withOptions(new import_commander25.Command("list").description("\uBCF4\uC548\uADF8\uB8F9 \uADDC\uCE59 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID")).action(async (value, _opts, cmd) => {
|
|
6131
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6132
|
+
const opts = cmd.optsWithGlobals();
|
|
6133
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6134
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uADDC\uCE59 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
6135
|
+
let rules;
|
|
6136
|
+
try {
|
|
6137
|
+
const id = await resolveSecurityGroupId(network, groupInput);
|
|
6138
|
+
rules = await network.listSecurityGroupRules(id);
|
|
6139
|
+
} catch (err) {
|
|
6140
|
+
stopSpinner(false);
|
|
6141
|
+
throw err;
|
|
6142
|
+
}
|
|
6143
|
+
stopSpinner(true);
|
|
6144
|
+
output(opts, {
|
|
6145
|
+
headers: ["id", "direction", "ethertype", "protocol", "ports", "remote", "description"],
|
|
6146
|
+
rows: rules.map((rule) => [
|
|
6147
|
+
rule.id,
|
|
6148
|
+
rule.direction,
|
|
6149
|
+
rule.ethertype,
|
|
6150
|
+
rule.protocol ?? "any",
|
|
6151
|
+
formatRulePorts(rule),
|
|
6152
|
+
formatRuleRemote(rule),
|
|
6153
|
+
rule.description ?? ""
|
|
6154
|
+
]),
|
|
6155
|
+
raw: rules,
|
|
6156
|
+
ids: rules.map((rule) => rule.id)
|
|
6157
|
+
});
|
|
6158
|
+
});
|
|
6159
|
+
var getCommand2 = withOptions(new import_commander25.Command("get").description("\uBCF4\uC548 \uADDC\uCE59\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<rule-id>", "\uBCF4\uC548 \uADDC\uCE59 UUID")).action(async (value, _opts, cmd) => {
|
|
6160
|
+
const ruleId = requireResourceInput(value, "\uBCF4\uC548 \uADDC\uCE59");
|
|
6161
|
+
const opts = cmd.optsWithGlobals();
|
|
6162
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6163
|
+
startSpinner("\uBCF4\uC548 \uADDC\uCE59 \uC870\uD68C \uC911...");
|
|
6164
|
+
let rule;
|
|
6165
|
+
try {
|
|
6166
|
+
rule = await network.getSecurityGroupRule(ruleId);
|
|
6167
|
+
} catch (err) {
|
|
6168
|
+
stopSpinner(false);
|
|
6169
|
+
throw err;
|
|
6170
|
+
}
|
|
6171
|
+
stopSpinner(true);
|
|
6172
|
+
outputRule(opts, rule);
|
|
6173
|
+
});
|
|
6174
|
+
var createCommand3 = withOptions(new import_commander25.Command("create").description(`\uBCF4\uC548 \uADDC\uCE59\uC744 \uC0DD\uC131\uD55C\uB2E4 ${REPLACE_NOTE}`).argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").requiredOption("--direction <direction>", "ingress \uB610\uB294 egress").option("--protocol <protocol>", "tcp, udp, icmp, any (\uAE30\uBCF8: any)").option("--port <port>", "\uB2E8\uC77C \uD3EC\uD2B8 (tcp\xB7udp)").option("--port-range <start-end>", "\uD3EC\uD2B8 \uBC94\uC704 (\uC608: 1000-2000, tcp\xB7udp)").option("--cidr <cidr>", "\uC6D0\uACA9 IPv4 \uC8FC\uC18C \uB610\uB294 CIDR").option("--remote-group <group>", "\uC6D0\uACA9 \uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--description <text>", "\uADDC\uCE59 \uC124\uBA85")).action(async (value, _opts, cmd) => {
|
|
6175
|
+
const opts = cmd.optsWithGlobals();
|
|
6176
|
+
const input = parseRuleInput(opts);
|
|
6177
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6178
|
+
const remoteGroupInput = input.remoteGroup === void 0 ? void 0 : requireResourceInput(input.remoteGroup, "\uC6D0\uACA9 \uBCF4\uC548\uADF8\uB8F9");
|
|
6179
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6180
|
+
startSpinner("\uBCF4\uC548 \uADDC\uCE59 \uC0DD\uC131 \uC911...");
|
|
6181
|
+
let rule;
|
|
6182
|
+
try {
|
|
6183
|
+
const groups = await network.listSecurityGroups();
|
|
6184
|
+
const groupId = resolveFromList(groups, groupInput, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6185
|
+
const remoteGroupId = remoteGroupInput === void 0 ? void 0 : resolveFromList(groups, remoteGroupInput, "\uC6D0\uACA9 \uBCF4\uC548\uADF8\uB8F9");
|
|
6186
|
+
rule = await network.createSecurityGroupRule(toCreateRuleParams(input, groupId, remoteGroupId));
|
|
6187
|
+
} catch (err) {
|
|
6188
|
+
stopSpinner(false);
|
|
6189
|
+
throw err;
|
|
6190
|
+
}
|
|
6191
|
+
stopSpinner(true);
|
|
6192
|
+
outputRule(opts, rule);
|
|
6193
|
+
});
|
|
6194
|
+
var deleteCommand2 = withOptions(new import_commander25.Command("delete").description(`\uBCF4\uC548 \uADDC\uCE59\uC744 \uC0AD\uC81C\uD55C\uB2E4 ${REPLACE_NOTE}`).argument("<rule-id>", "\uBCF4\uC548 \uADDC\uCE59 UUID").option("--yes", "\uC0AD\uC81C \uD655\uC778")).action(async (value, _opts, cmd) => {
|
|
6195
|
+
const opts = cmd.optsWithGlobals();
|
|
6196
|
+
requireYes(opts.yes, "\uBCF4\uC548 \uADDC\uCE59 \uC0AD\uC81C");
|
|
6197
|
+
const ruleId = requireResourceInput(value, "\uBCF4\uC548 \uADDC\uCE59");
|
|
6198
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6199
|
+
startSpinner("\uBCF4\uC548 \uADDC\uCE59 \uC0AD\uC81C \uC911...");
|
|
6200
|
+
try {
|
|
6201
|
+
await network.deleteSecurityGroupRule(ruleId);
|
|
6202
|
+
} catch (err) {
|
|
6203
|
+
stopSpinner(false);
|
|
6204
|
+
throw err;
|
|
6205
|
+
}
|
|
6206
|
+
stopSpinner(true);
|
|
6207
|
+
const result = { operation: "security-group-rule-delete", status: "succeeded", security_group_rule_id: ruleId };
|
|
6208
|
+
output(opts, {
|
|
6209
|
+
headers: ["field", "value"],
|
|
6210
|
+
rows: Object.entries(result).map(([key, field]) => [key, field]),
|
|
6211
|
+
raw: result,
|
|
6212
|
+
ids: [ruleId]
|
|
6213
|
+
});
|
|
6214
|
+
});
|
|
6215
|
+
var ruleCommand = new import_commander25.Command("rule").description("\uBCF4\uC548 \uADDC\uCE59 \uC870\uD68C\uC640 \uBCC0\uACBD").addCommand(listCommand4).addCommand(getCommand2).addCommand(createCommand3).addCommand(deleteCommand2);
|
|
6216
|
+
|
|
6217
|
+
// src/commands/network/security-group.ts
|
|
6218
|
+
function optsOf(cmd) {
|
|
6219
|
+
return cmd.optsWithGlobals();
|
|
6220
|
+
}
|
|
6221
|
+
var listCommand5 = withOptions(new import_commander26.Command("list").description("\uBCF4\uC548\uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4")).action(async (_opts, cmd) => {
|
|
6222
|
+
const opts = optsOf(cmd);
|
|
6223
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6224
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
6225
|
+
let groups;
|
|
6226
|
+
try {
|
|
6227
|
+
groups = await network.listSecurityGroups();
|
|
6228
|
+
} catch (err) {
|
|
6229
|
+
stopSpinner(false);
|
|
6230
|
+
throw err;
|
|
6231
|
+
}
|
|
6232
|
+
stopSpinner(true);
|
|
6233
|
+
output(opts, {
|
|
6234
|
+
headers: ["id", "name", "description", "rules"],
|
|
6235
|
+
rows: groups.map((group) => [group.id, group.name, group.description, String(group.security_group_rules.length)]),
|
|
6236
|
+
raw: groups,
|
|
6237
|
+
ids: groups.map((group) => group.id)
|
|
6238
|
+
});
|
|
6239
|
+
});
|
|
6240
|
+
var getCommand3 = withOptions(new import_commander26.Command("get").description("\uBCF4\uC548\uADF8\uB8F9\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID")).action(async (value, _opts, cmd) => {
|
|
6241
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6242
|
+
const opts = optsOf(cmd);
|
|
6243
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6244
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uC870\uD68C \uC911...");
|
|
6245
|
+
let group;
|
|
6246
|
+
try {
|
|
6247
|
+
const id = await resolveSecurityGroupId(network, groupInput);
|
|
6248
|
+
group = await network.getSecurityGroup(id);
|
|
6249
|
+
} catch (err) {
|
|
6250
|
+
stopSpinner(false);
|
|
6251
|
+
throw err;
|
|
6252
|
+
}
|
|
6253
|
+
stopSpinner(true);
|
|
6254
|
+
output(opts, {
|
|
6255
|
+
headers: ["field", "value"],
|
|
6256
|
+
rows: [
|
|
6257
|
+
["id", group.id],
|
|
6258
|
+
["name", group.name],
|
|
6259
|
+
["description", group.description],
|
|
6260
|
+
["tenant_id", group.tenant_id],
|
|
6261
|
+
["rules", String(group.security_group_rules.length)]
|
|
6262
|
+
],
|
|
6263
|
+
raw: group,
|
|
6264
|
+
ids: [group.id]
|
|
6265
|
+
});
|
|
6266
|
+
});
|
|
6267
|
+
var portsCommand = withOptions(new import_commander26.Command("ports").description("\uBCF4\uC548\uADF8\uB8F9\uC5D0 \uC5F0\uACB0\uB41C \uD3EC\uD2B8\uC640 \uC778\uC2A4\uD134\uC2A4\uB97C \uC870\uD68C\uD55C\uB2E4 (--quiet\uB294 \uC778\uC2A4\uD134\uC2A4 UUID)").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID")).action(async (value, _opts, cmd) => {
|
|
6268
|
+
const groupInput = requireResourceInput(value, "\uBCF4\uC548\uADF8\uB8F9");
|
|
6269
|
+
const opts = optsOf(cmd);
|
|
6270
|
+
const { network, instance } = await resolveSecurityGroupClients(opts);
|
|
6271
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uD3EC\uD2B8 \uC870\uD68C \uC911...");
|
|
6272
|
+
let ports;
|
|
6273
|
+
let warning = null;
|
|
6274
|
+
try {
|
|
6275
|
+
const id = await resolveSecurityGroupId(network, groupInput);
|
|
6276
|
+
const listedPorts = await network.listSecurityGroupPorts(id);
|
|
6277
|
+
let names = /* @__PURE__ */ new Map();
|
|
6278
|
+
if (listedPorts.some((port) => port.device_owner.startsWith("compute:"))) {
|
|
6279
|
+
try {
|
|
6280
|
+
names = new Map((await instance.list()).map((server) => [server.id, server.name]));
|
|
6281
|
+
} catch (err) {
|
|
6282
|
+
warning = err instanceof NhnCloudCliError ? err.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958";
|
|
6283
|
+
}
|
|
6284
|
+
}
|
|
6285
|
+
ports = listedPorts.map((port) => ({
|
|
6286
|
+
...port,
|
|
6287
|
+
instance_name: port.device_owner.startsWith("compute:") ? names.get(port.device_id) ?? null : null
|
|
6288
|
+
}));
|
|
6289
|
+
} catch (err) {
|
|
6290
|
+
stopSpinner(false);
|
|
6291
|
+
throw err;
|
|
6292
|
+
}
|
|
6293
|
+
stopSpinner(true);
|
|
6294
|
+
if (warning !== null) process.stderr.write(`\uACBD\uACE0: \uC778\uC2A4\uD134\uC2A4 \uC774\uB984\uC744 \uC870\uD68C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${warning}
|
|
6295
|
+
`);
|
|
6296
|
+
output(opts, {
|
|
6297
|
+
headers: ["port_id", "device_id", "instance_name", "device_owner", "fixed_ips", "security_groups"],
|
|
6298
|
+
rows: ports.map((port) => [
|
|
6299
|
+
port.id,
|
|
6300
|
+
port.device_id,
|
|
6301
|
+
port.instance_name ?? "",
|
|
6302
|
+
port.device_owner,
|
|
6303
|
+
port.fixed_ips.map((ip) => ip.ip_address).join(","),
|
|
6304
|
+
port.security_groups.join(",")
|
|
6305
|
+
]),
|
|
6306
|
+
raw: ports,
|
|
6307
|
+
ids: [...new Set(ports.filter((port) => port.device_owner.startsWith("compute:")).map((port) => port.device_id))]
|
|
6308
|
+
});
|
|
6309
|
+
});
|
|
6310
|
+
var securityGroupCommand = new import_commander26.Command("security-group").description("\uBCF4\uC548\uADF8\uB8F9 \uC870\uD68C\uC640 \uBCC0\uACBD").addCommand(listCommand5).addCommand(getCommand3).addCommand(portsCommand).addCommand(createCommand2).addCommand(updateCommand).addCommand(deleteCommand).addCommand(ruleCommand);
|
|
6311
|
+
|
|
6312
|
+
// src/commands/floatingip/list.ts
|
|
6313
|
+
var import_commander27 = require("commander");
|
|
6314
|
+
var listCommand6 = new import_commander27.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) => {
|
|
5614
6315
|
const opts = cmd.optsWithGlobals();
|
|
5615
6316
|
const { client } = await resolveNetworkClient(opts);
|
|
5616
6317
|
startSpinner("Floating IP \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5637,9 +6338,9 @@ var listCommand4 = new import_commander24.Command("list").description("Floating
|
|
|
5637
6338
|
});
|
|
5638
6339
|
|
|
5639
6340
|
// src/commands/floatingip/create.ts
|
|
5640
|
-
var
|
|
6341
|
+
var import_commander28 = require("commander");
|
|
5641
6342
|
var import_chalk6 = __toESM(require("chalk"));
|
|
5642
|
-
var
|
|
6343
|
+
var createCommand4 = new import_commander28.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) => {
|
|
5643
6344
|
const opts = cmd.optsWithGlobals();
|
|
5644
6345
|
const { client } = await resolveNetworkClient(opts);
|
|
5645
6346
|
let networkId = opts.network;
|
|
@@ -5682,9 +6383,9 @@ var createCommand2 = new import_commander25.Command("create").description("Float
|
|
|
5682
6383
|
});
|
|
5683
6384
|
|
|
5684
6385
|
// src/commands/floatingip/delete.ts
|
|
5685
|
-
var
|
|
6386
|
+
var import_commander29 = require("commander");
|
|
5686
6387
|
var import_chalk7 = __toESM(require("chalk"));
|
|
5687
|
-
var
|
|
6388
|
+
var deleteCommand3 = new import_commander29.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) => {
|
|
5688
6389
|
const opts = cmd.optsWithGlobals();
|
|
5689
6390
|
const isTTY = process.stdin.isTTY;
|
|
5690
6391
|
if (!isTTY && !opts.yes) {
|
|
@@ -5718,8 +6419,8 @@ var deleteCommand = new import_commander26.Command("delete").description("Floati
|
|
|
5718
6419
|
});
|
|
5719
6420
|
|
|
5720
6421
|
// src/commands/instance/flavors.ts
|
|
5721
|
-
var
|
|
5722
|
-
var flavorsCommand = new
|
|
6422
|
+
var import_commander30 = require("commander");
|
|
6423
|
+
var flavorsCommand = new import_commander30.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) => {
|
|
5723
6424
|
const opts = cmd.optsWithGlobals();
|
|
5724
6425
|
const minDisk = parseNonNegativeIntegerOption(opts.minDisk, "--min-disk");
|
|
5725
6426
|
const minRam = parseNonNegativeIntegerOption(opts.minRam, "--min-ram");
|
|
@@ -5762,8 +6463,8 @@ function isDetailList(flavors) {
|
|
|
5762
6463
|
}
|
|
5763
6464
|
|
|
5764
6465
|
// src/commands/instance/availability-zones.ts
|
|
5765
|
-
var
|
|
5766
|
-
var availabilityZonesCommand = new
|
|
6466
|
+
var import_commander31 = require("commander");
|
|
6467
|
+
var availabilityZonesCommand = new import_commander31.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) => {
|
|
5767
6468
|
const opts = cmd.optsWithGlobals();
|
|
5768
6469
|
const { client } = await resolveInstanceClient(opts);
|
|
5769
6470
|
startSpinner("\uAC00\uC6A9\uC131 \uC601\uC5ED \uC870\uD68C \uC911...");
|
|
@@ -5784,14 +6485,14 @@ var availabilityZonesCommand = new import_commander28.Command("availability-zone
|
|
|
5784
6485
|
});
|
|
5785
6486
|
|
|
5786
6487
|
// src/commands/instance/get.ts
|
|
5787
|
-
var
|
|
6488
|
+
var import_commander32 = require("commander");
|
|
5788
6489
|
function getIps2(server) {
|
|
5789
6490
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
5790
6491
|
}
|
|
5791
6492
|
function getImageId(server) {
|
|
5792
6493
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5793
6494
|
}
|
|
5794
|
-
var
|
|
6495
|
+
var getCommand4 = new import_commander32.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) => {
|
|
5795
6496
|
const opts = cmd.optsWithGlobals();
|
|
5796
6497
|
const { client } = await resolveInstanceClient(opts);
|
|
5797
6498
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uC870\uD68C \uC911...");
|
|
@@ -5823,7 +6524,7 @@ var getCommand2 = new import_commander29.Command("get").description("\uB2E8\uC77
|
|
|
5823
6524
|
});
|
|
5824
6525
|
|
|
5825
6526
|
// src/commands/instance/create.ts
|
|
5826
|
-
var
|
|
6527
|
+
var import_commander33 = require("commander");
|
|
5827
6528
|
var import_node_fs7 = require("fs");
|
|
5828
6529
|
var import_chalk8 = __toESM(require("chalk"));
|
|
5829
6530
|
function getFirstIp(server) {
|
|
@@ -5840,7 +6541,7 @@ function getIps3(server) {
|
|
|
5840
6541
|
function getImageId2(server) {
|
|
5841
6542
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5842
6543
|
}
|
|
5843
|
-
var
|
|
6544
|
+
var createCommand5 = new import_commander33.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) => {
|
|
5844
6545
|
const opts = cmd.optsWithGlobals();
|
|
5845
6546
|
const networks = opts.network ?? [];
|
|
5846
6547
|
if (networks.length === 0) {
|
|
@@ -5939,9 +6640,9 @@ var createCommand3 = new import_commander30.Command("create").description("\uC77
|
|
|
5939
6640
|
});
|
|
5940
6641
|
|
|
5941
6642
|
// src/commands/instance/delete.ts
|
|
5942
|
-
var
|
|
6643
|
+
var import_commander34 = require("commander");
|
|
5943
6644
|
var import_chalk9 = __toESM(require("chalk"));
|
|
5944
|
-
var
|
|
6645
|
+
var deleteCommand4 = new import_commander34.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) => {
|
|
5945
6646
|
const opts = cmd.optsWithGlobals();
|
|
5946
6647
|
const isTTY = process.stdin.isTTY;
|
|
5947
6648
|
if (!isTTY && !opts.yes) {
|
|
@@ -5975,9 +6676,9 @@ var deleteCommand2 = new import_commander31.Command("delete").description("\uC77
|
|
|
5975
6676
|
});
|
|
5976
6677
|
|
|
5977
6678
|
// src/commands/instance/power.ts
|
|
5978
|
-
var
|
|
6679
|
+
var import_commander35 = require("commander");
|
|
5979
6680
|
var import_chalk10 = __toESM(require("chalk"));
|
|
5980
|
-
var startCommand = new
|
|
6681
|
+
var startCommand = new import_commander35.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) => {
|
|
5981
6682
|
const opts = cmd.optsWithGlobals();
|
|
5982
6683
|
const { client } = await resolveInstanceClient(opts);
|
|
5983
6684
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC2DC\uC791 \uC911... (id: ${id})`);
|
|
@@ -5991,7 +6692,7 @@ var startCommand = new import_commander32.Command("start").description("\uC778\u
|
|
|
5991
6692
|
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC2DC\uC791\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 ACTIVE).
|
|
5992
6693
|
`));
|
|
5993
6694
|
});
|
|
5994
|
-
var stopCommand = new
|
|
6695
|
+
var stopCommand = new import_commander35.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) => {
|
|
5995
6696
|
const opts = cmd.optsWithGlobals();
|
|
5996
6697
|
const { client } = await resolveInstanceClient(opts);
|
|
5997
6698
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC815\uC9C0 \uC911... (id: ${id})`);
|
|
@@ -6005,7 +6706,7 @@ var stopCommand = new import_commander32.Command("stop").description("\uC778\uC2
|
|
|
6005
6706
|
process.stderr.write(import_chalk10.default.green(`\u2713 \uC778\uC2A4\uD134\uC2A4 "${id}" \uC815\uC9C0\uB97C \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4 (\u2192 SHUTOFF).
|
|
6006
6707
|
`));
|
|
6007
6708
|
});
|
|
6008
|
-
var rebootCommand = new
|
|
6709
|
+
var rebootCommand = new import_commander35.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) => {
|
|
6009
6710
|
const opts = cmd.optsWithGlobals();
|
|
6010
6711
|
const { client } = await resolveInstanceClient(opts);
|
|
6011
6712
|
const type = opts.hard ? "HARD" : "SOFT";
|
|
@@ -6022,9 +6723,9 @@ var rebootCommand = new import_commander32.Command("reboot").description("\uC778
|
|
|
6022
6723
|
});
|
|
6023
6724
|
|
|
6024
6725
|
// src/commands/instance/resize.ts
|
|
6025
|
-
var
|
|
6726
|
+
var import_commander36 = require("commander");
|
|
6026
6727
|
var import_chalk11 = __toESM(require("chalk"));
|
|
6027
|
-
var resizeCommand = new
|
|
6728
|
+
var resizeCommand = new import_commander36.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) => {
|
|
6028
6729
|
const opts = cmd.optsWithGlobals();
|
|
6029
6730
|
const { client } = await resolveInstanceClient(opts);
|
|
6030
6731
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785 \uBCC0\uACBD \uC911... (id: ${id})`);
|
|
@@ -6042,7 +6743,7 @@ var resizeCommand = new import_commander33.Command("resize").description("\uC778
|
|
|
6042
6743
|
)
|
|
6043
6744
|
);
|
|
6044
6745
|
});
|
|
6045
|
-
var resizeConfirmCommand = new
|
|
6746
|
+
var resizeConfirmCommand = new import_commander36.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) => {
|
|
6046
6747
|
const opts = cmd.optsWithGlobals();
|
|
6047
6748
|
const { client } = await resolveInstanceClient(opts);
|
|
6048
6749
|
startSpinner(`resize \uD655\uC815 \uC911... (id: ${id})`);
|
|
@@ -6056,7 +6757,7 @@ var resizeConfirmCommand = new import_commander33.Command("resize-confirm").desc
|
|
|
6056
6757
|
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).
|
|
6057
6758
|
`));
|
|
6058
6759
|
});
|
|
6059
|
-
var resizeRevertCommand = new
|
|
6760
|
+
var resizeRevertCommand = new import_commander36.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) => {
|
|
6060
6761
|
const opts = cmd.optsWithGlobals();
|
|
6061
6762
|
const { client } = await resolveInstanceClient(opts);
|
|
6062
6763
|
startSpinner(`resize \uB864\uBC31 \uC911... (id: ${id})`);
|
|
@@ -6074,9 +6775,9 @@ var resizeRevertCommand = new import_commander33.Command("resize-revert").descri
|
|
|
6074
6775
|
});
|
|
6075
6776
|
|
|
6076
6777
|
// src/commands/instance/images.ts
|
|
6077
|
-
var
|
|
6778
|
+
var import_commander37 = require("commander");
|
|
6078
6779
|
var VISIBILITY_VALUES = ["public", "private", "shared"];
|
|
6079
|
-
var imagesCommand = new
|
|
6780
|
+
var imagesCommand = new import_commander37.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) => {
|
|
6080
6781
|
const opts = cmd.optsWithGlobals();
|
|
6081
6782
|
const limit = parsePositiveIntegerOption(opts.limit, "--limit");
|
|
6082
6783
|
if (opts.visibility !== void 0 && !VISIBILITY_VALUES.includes(opts.visibility)) {
|
|
@@ -6124,8 +6825,8 @@ var imagesCommand = new import_commander34.Command("images").description("\uC774
|
|
|
6124
6825
|
});
|
|
6125
6826
|
|
|
6126
6827
|
// src/commands/instance/keypairs.ts
|
|
6127
|
-
var
|
|
6128
|
-
var keypairsCommand = new
|
|
6828
|
+
var import_commander38 = require("commander");
|
|
6829
|
+
var keypairsCommand = new import_commander38.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) => {
|
|
6129
6830
|
const opts = cmd.optsWithGlobals();
|
|
6130
6831
|
const { client } = await resolveInstanceClient(opts);
|
|
6131
6832
|
startSpinner("\uD0A4\uD398\uC5B4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6146,7 +6847,7 @@ var keypairsCommand = new import_commander35.Command("keypairs").description("\u
|
|
|
6146
6847
|
});
|
|
6147
6848
|
|
|
6148
6849
|
// src/commands/instance/keypair.ts
|
|
6149
|
-
var
|
|
6850
|
+
var import_commander39 = require("commander");
|
|
6150
6851
|
var import_node_fs8 = require("fs");
|
|
6151
6852
|
var import_node_crypto5 = require("crypto");
|
|
6152
6853
|
var import_chalk12 = __toESM(require("chalk"));
|
|
@@ -6189,7 +6890,7 @@ function savePrivateKey(filePath, privateKey) {
|
|
|
6189
6890
|
);
|
|
6190
6891
|
}
|
|
6191
6892
|
}
|
|
6192
|
-
var getKeypairCmd = new
|
|
6893
|
+
var getKeypairCmd = new import_commander39.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) => {
|
|
6193
6894
|
const opts = cmd.optsWithGlobals();
|
|
6194
6895
|
const { client } = await resolveInstanceClient(opts);
|
|
6195
6896
|
startSpinner("\uD0A4\uD398\uC5B4 \uC870\uD68C \uC911...");
|
|
@@ -6214,7 +6915,7 @@ var getKeypairCmd = new import_commander36.Command("get").description("\uB2E8\uC
|
|
|
6214
6915
|
ids: [kp.name]
|
|
6215
6916
|
});
|
|
6216
6917
|
});
|
|
6217
|
-
var createKeypairCmd = new
|
|
6918
|
+
var createKeypairCmd = new import_commander39.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) => {
|
|
6218
6919
|
const opts = cmd.optsWithGlobals();
|
|
6219
6920
|
const publicKey = opts.publicKey !== void 0 ? resolvePublicKey(opts.publicKey) : void 0;
|
|
6220
6921
|
if (opts.output !== void 0 && publicKey !== void 0) {
|
|
@@ -6273,7 +6974,7 @@ var createKeypairCmd = new import_commander36.Command("create").description("\uD
|
|
|
6273
6974
|
ids: [meta.name]
|
|
6274
6975
|
});
|
|
6275
6976
|
});
|
|
6276
|
-
var deleteKeypairCmd = new
|
|
6977
|
+
var deleteKeypairCmd = new import_commander39.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) => {
|
|
6277
6978
|
const opts = cmd.optsWithGlobals();
|
|
6278
6979
|
const { client } = await resolveInstanceClient(opts);
|
|
6279
6980
|
startSpinner("\uD0A4\uD398\uC5B4 \uC0AD\uC81C \uC911...");
|
|
@@ -6287,12 +6988,12 @@ var deleteKeypairCmd = new import_commander36.Command("delete").description("\uD
|
|
|
6287
6988
|
process.stderr.write(import_chalk12.default.green(`\u2713 \uD0A4\uD398\uC5B4 "${name}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
6288
6989
|
`));
|
|
6289
6990
|
});
|
|
6290
|
-
var keypairCommand = new
|
|
6991
|
+
var keypairCommand = new import_commander39.Command("keypair").description("\uD0A4\uD398\uC5B4 \uB2E8\uAC74 \uAD00\uB9AC (get / create / delete)").addCommand(getKeypairCmd).addCommand(createKeypairCmd).addCommand(deleteKeypairCmd);
|
|
6291
6992
|
|
|
6292
6993
|
// src/commands/instance/volume.ts
|
|
6293
|
-
var
|
|
6994
|
+
var import_commander40 = require("commander");
|
|
6294
6995
|
var import_chalk13 = __toESM(require("chalk"));
|
|
6295
|
-
var attachCommand = new
|
|
6996
|
+
var attachCommand = new import_commander40.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) => {
|
|
6296
6997
|
const opts = cmd.optsWithGlobals();
|
|
6297
6998
|
const { client } = await resolveInstanceClient(opts);
|
|
6298
6999
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uC911...");
|
|
@@ -6320,7 +7021,7 @@ var attachCommand = new import_commander37.Command("attach").description("\uBCFC
|
|
|
6320
7021
|
ids: [att.id]
|
|
6321
7022
|
});
|
|
6322
7023
|
});
|
|
6323
|
-
var detachCommand = new
|
|
7024
|
+
var detachCommand = new import_commander40.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) => {
|
|
6324
7025
|
const opts = cmd.optsWithGlobals();
|
|
6325
7026
|
const { client } = await resolveInstanceClient(opts);
|
|
6326
7027
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -6336,15 +7037,15 @@ var detachCommand = new import_commander37.Command("detach").description("\uBCFC
|
|
|
6336
7037
|
`)
|
|
6337
7038
|
);
|
|
6338
7039
|
});
|
|
6339
|
-
var volumeCommand = new
|
|
7040
|
+
var volumeCommand = new import_commander40.Command("volume").description(
|
|
6340
7041
|
"\uC778\uC2A4\uD134\uC2A4 \uBCFC\uB968 \uC5F0\uACB0/\uD574\uC81C"
|
|
6341
7042
|
);
|
|
6342
7043
|
volumeCommand.addCommand(attachCommand);
|
|
6343
7044
|
volumeCommand.addCommand(detachCommand);
|
|
6344
7045
|
|
|
6345
7046
|
// src/commands/instance/volumes.ts
|
|
6346
|
-
var
|
|
6347
|
-
var volumesCommand = new
|
|
7047
|
+
var import_commander41 = require("commander");
|
|
7048
|
+
var volumesCommand = new import_commander41.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) => {
|
|
6348
7049
|
const opts = cmd.optsWithGlobals();
|
|
6349
7050
|
const { client } = await resolveInstanceClient(opts);
|
|
6350
7051
|
startSpinner("\uBCFC\uB968 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6364,11 +7065,91 @@ var volumesCommand = new import_commander38.Command("volumes").description("\uC7
|
|
|
6364
7065
|
});
|
|
6365
7066
|
});
|
|
6366
7067
|
|
|
7068
|
+
// src/commands/instance/security-group.ts
|
|
7069
|
+
var import_commander42 = require("commander");
|
|
7070
|
+
var ACTIONS = {
|
|
7071
|
+
add: { operation: "instance-security-group-add", label: "\uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uCD94\uAC00", spinner: "\uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uCD94\uAC00 \uC911..." },
|
|
7072
|
+
remove: { operation: "instance-security-group-remove", label: "\uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uD574\uC81C", spinner: "\uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uD574\uC81C \uC911..." }
|
|
7073
|
+
};
|
|
7074
|
+
async function isAttached(network, groupId, instanceId) {
|
|
7075
|
+
const ports = await network.listSecurityGroupPorts(groupId);
|
|
7076
|
+
return ports.some((port) => port.device_id === instanceId);
|
|
7077
|
+
}
|
|
7078
|
+
async function requestChange(instance, action, instanceId, groupName) {
|
|
7079
|
+
if (action === "add") await instance.addSecurityGroup(instanceId, groupName);
|
|
7080
|
+
else await instance.removeSecurityGroup(instanceId, groupName);
|
|
7081
|
+
}
|
|
7082
|
+
async function runAction(action, instanceArg, groupArg, opts) {
|
|
7083
|
+
const { operation, label, spinner } = ACTIONS[action];
|
|
7084
|
+
requireYes(opts.yes, label);
|
|
7085
|
+
const instanceId = requireResourceInput(instanceArg, "\uC778\uC2A4\uD134\uC2A4");
|
|
7086
|
+
const groupInput = requireResourceInput(groupArg, "\uBCF4\uC548\uADF8\uB8F9");
|
|
7087
|
+
const { network, instance } = await resolveSecurityGroupClients(opts);
|
|
7088
|
+
startSpinner(spinner);
|
|
7089
|
+
let groupId;
|
|
7090
|
+
let groupName;
|
|
7091
|
+
let requested = false;
|
|
7092
|
+
try {
|
|
7093
|
+
const groups = await network.listSecurityGroups();
|
|
7094
|
+
groupId = resolveFromList(groups, groupInput, "\uBCF4\uC548\uADF8\uB8F9");
|
|
7095
|
+
groupName = requireUniqueGroupName(groups, groupId).name;
|
|
7096
|
+
const attached = await isAttached(network, groupId, instanceId);
|
|
7097
|
+
if (action === "remove" && !attached) {
|
|
7098
|
+
throw new NhnCloudCliError(
|
|
7099
|
+
`\uC778\uC2A4\uD134\uC2A4 ${instanceId}\uC5D0 \uBCF4\uC548\uADF8\uB8F9 ${groupName}\uC774 \uC5F0\uACB0\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.`,
|
|
7100
|
+
EXIT_PARAM_ERROR
|
|
7101
|
+
);
|
|
7102
|
+
}
|
|
7103
|
+
if (action === "remove" || !attached) {
|
|
7104
|
+
await requestChange(instance, action, instanceId, groupName);
|
|
7105
|
+
requested = true;
|
|
7106
|
+
}
|
|
7107
|
+
} catch (err) {
|
|
7108
|
+
stopSpinner(false);
|
|
7109
|
+
throw err;
|
|
7110
|
+
}
|
|
7111
|
+
let warning;
|
|
7112
|
+
if (requested) {
|
|
7113
|
+
const safeGroupId = sanitizeForTerminal(groupId);
|
|
7114
|
+
try {
|
|
7115
|
+
const attachedAfter = await isAttached(network, groupId, instanceId);
|
|
7116
|
+
if (attachedAfter !== (action === "add")) {
|
|
7117
|
+
warning = `\uACBD\uACE0: \uC694\uCCAD\uC740 \uC811\uC218\uB410\uC9C0\uB9CC \uC5F0\uACB0 \uC870\uD68C\uC5D0 \uC544\uC9C1 \uBC18\uC601\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. network security-group ports ${safeGroupId}\uB85C \uB2E4\uC2DC \uD655\uC778\uD558\uC138\uC694.
|
|
7118
|
+
`;
|
|
7119
|
+
}
|
|
7120
|
+
} catch {
|
|
7121
|
+
warning = `\uACBD\uACE0: \uC694\uCCAD\uC740 \uC811\uC218\uB410\uC9C0\uB9CC \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. network security-group ports ${safeGroupId}\uB85C \uB2E4\uC2DC \uD655\uC778\uD558\uC138\uC694.
|
|
7122
|
+
`;
|
|
7123
|
+
}
|
|
7124
|
+
}
|
|
7125
|
+
stopSpinner(true);
|
|
7126
|
+
if (warning) process.stderr.write(warning);
|
|
7127
|
+
const result = {
|
|
7128
|
+
operation,
|
|
7129
|
+
status: requested ? "succeeded" : "unchanged",
|
|
7130
|
+
instance_id: instanceId,
|
|
7131
|
+
security_group_id: groupId,
|
|
7132
|
+
security_group_name: groupName
|
|
7133
|
+
};
|
|
7134
|
+
output(opts, {
|
|
7135
|
+
headers: ["field", "value"],
|
|
7136
|
+
rows: Object.entries(result).map(([key, value]) => [key, value]),
|
|
7137
|
+
raw: result,
|
|
7138
|
+
ids: [instanceId]
|
|
7139
|
+
});
|
|
7140
|
+
}
|
|
7141
|
+
function actionCommand(action, description) {
|
|
7142
|
+
return withOptions(new import_commander42.Command(action).description(description).argument("<instance-id>", "\uC778\uC2A4\uD134\uC2A4 UUID").argument("<group>", "\uBCF4\uC548\uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--yes", `${ACTIONS[action].label} \uD655\uC778`)).action(async (instanceArg, groupArg, _opts, cmd) => {
|
|
7143
|
+
await runAction(action, instanceArg, groupArg, cmd.optsWithGlobals());
|
|
7144
|
+
});
|
|
7145
|
+
}
|
|
7146
|
+
var securityGroupCommand2 = new import_commander42.Command("security-group").description("\uC778\uC2A4\uD134\uC2A4\uC758 \uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0 \uBCC0\uACBD").addCommand(actionCommand("add", "\uC778\uC2A4\uD134\uC2A4\uC5D0 \uBCF4\uC548\uADF8\uB8F9\uC744 \uC5F0\uACB0\uD55C\uB2E4 (\uB2E4\uB978 \uC5F0\uACB0\uC740 \uC720\uC9C0\uD55C\uB2E4)")).addCommand(actionCommand("remove", "\uC778\uC2A4\uD134\uC2A4\uC5D0\uC11C \uBCF4\uC548\uADF8\uB8F9 \uC5F0\uACB0\uC744 \uD574\uC81C\uD55C\uB2E4 (\uB2E4\uB978 \uC5F0\uACB0\uC740 \uC720\uC9C0\uD55C\uB2E4)"));
|
|
7147
|
+
|
|
6367
7148
|
// src/commands/ncr/list.ts
|
|
6368
|
-
var
|
|
7149
|
+
var import_commander43 = require("commander");
|
|
6369
7150
|
|
|
6370
7151
|
// src/services/ncr/harbor-client.ts
|
|
6371
|
-
var
|
|
7152
|
+
var import_ky13 = __toESM(require("ky"));
|
|
6372
7153
|
var PAGE_SIZE = 100;
|
|
6373
7154
|
var MAX_PAGES = 1e3;
|
|
6374
7155
|
var HarborClient = class {
|
|
@@ -6397,7 +7178,7 @@ var HarborClient = class {
|
|
|
6397
7178
|
try {
|
|
6398
7179
|
for (; ; ) {
|
|
6399
7180
|
const url = `https://${this.host}${path5}?page=${page}&page_size=${PAGE_SIZE}`;
|
|
6400
|
-
const res = await
|
|
7181
|
+
const res = await import_ky13.default.get(url, {
|
|
6401
7182
|
headers: this.basicAuthHeaders(),
|
|
6402
7183
|
retry: 0,
|
|
6403
7184
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -6493,7 +7274,7 @@ function parseHarborHost(uri) {
|
|
|
6493
7274
|
}
|
|
6494
7275
|
|
|
6495
7276
|
// src/commands/ncr/list.ts
|
|
6496
|
-
var
|
|
7277
|
+
var listCommand7 = new import_commander43.Command("list").description("NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
6497
7278
|
const opts = cmd.optsWithGlobals();
|
|
6498
7279
|
const { client, profileName } = await createNcrClient(opts);
|
|
6499
7280
|
const appKey = await resolveAppKey(profileName);
|
|
@@ -6519,8 +7300,8 @@ var listCommand5 = new import_commander39.Command("list").description("NCR \uB80
|
|
|
6519
7300
|
});
|
|
6520
7301
|
|
|
6521
7302
|
// src/commands/ncr/get.ts
|
|
6522
|
-
var
|
|
6523
|
-
var
|
|
7303
|
+
var import_commander44 = require("commander");
|
|
7304
|
+
var getCommand5 = new import_commander44.Command("get").description("\uB2E8\uC77C NCR \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984 \uB610\uB294 ID").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
6524
7305
|
const opts = cmd.optsWithGlobals();
|
|
6525
7306
|
if (!registry.trim()) {
|
|
6526
7307
|
throw new NhnCloudCliError(
|
|
@@ -6548,8 +7329,8 @@ var getCommand3 = new import_commander40.Command("get").description("\uB2E8\uC77
|
|
|
6548
7329
|
});
|
|
6549
7330
|
|
|
6550
7331
|
// src/commands/ncr/images.ts
|
|
6551
|
-
var
|
|
6552
|
-
var imagesCommand2 = new
|
|
7332
|
+
var import_commander45 = require("commander");
|
|
7333
|
+
var imagesCommand2 = new import_commander45.Command("images").description("\uB808\uC9C0\uC2A4\uD2B8\uB9AC\uC758 \uC774\uBBF8\uC9C0(repository) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, _opts, cmd) => {
|
|
6553
7334
|
const opts = cmd.optsWithGlobals();
|
|
6554
7335
|
if (!registry.trim()) {
|
|
6555
7336
|
throw new NhnCloudCliError(
|
|
@@ -6583,8 +7364,8 @@ var imagesCommand2 = new import_commander41.Command("images").description("\uB80
|
|
|
6583
7364
|
});
|
|
6584
7365
|
|
|
6585
7366
|
// src/commands/ncr/tags.ts
|
|
6586
|
-
var
|
|
6587
|
-
var tagsCommand = new
|
|
7367
|
+
var import_commander46 = require("commander");
|
|
7368
|
+
var tagsCommand = new import_commander46.Command("tags").description("\uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD0DC\uADF8 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<registry>", "\uB808\uC9C0\uC2A4\uD2B8\uB9AC \uC774\uB984").argument("<repository>", "\uC774\uBBF8\uC9C0(repository) \uC774\uB984 (\uC9E7\uC740 \uC774\uB984 \uB610\uB294 {project}/{repo})").option("--region <region>", "NCR region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (registry, repository, _opts, cmd) => {
|
|
6588
7369
|
const opts = cmd.optsWithGlobals();
|
|
6589
7370
|
if (!registry.trim()) {
|
|
6590
7371
|
throw new NhnCloudCliError(
|
|
@@ -6625,7 +7406,7 @@ var tagsCommand = new import_commander42.Command("tags").description("\uD2B9\uC8
|
|
|
6625
7406
|
});
|
|
6626
7407
|
|
|
6627
7408
|
// src/commands/commands.ts
|
|
6628
|
-
var
|
|
7409
|
+
var import_commander47 = require("commander");
|
|
6629
7410
|
function commandPath(command) {
|
|
6630
7411
|
const names = [];
|
|
6631
7412
|
let current2 = command;
|
|
@@ -6663,7 +7444,7 @@ function collectCommandCatalog(program2) {
|
|
|
6663
7444
|
return { commands };
|
|
6664
7445
|
}
|
|
6665
7446
|
function createCommandsCommand(program2) {
|
|
6666
|
-
return new
|
|
7447
|
+
return new import_commander47.Command("commands").description("\uBA85\uB839 \uACBD\uB85C\uC640 \uC635\uC158 catalog\uB97C \uCD9C\uB825\uD55C\uB2E4").action((_opts, cmd) => {
|
|
6667
7448
|
const opts = cmd.optsWithGlobals();
|
|
6668
7449
|
const catalog = collectCommandCatalog(program2);
|
|
6669
7450
|
output(opts, {
|
|
@@ -6680,13 +7461,13 @@ function createCommandsCommand(program2) {
|
|
|
6680
7461
|
}
|
|
6681
7462
|
|
|
6682
7463
|
// src/commands/nks/supports.ts
|
|
6683
|
-
var
|
|
7464
|
+
var import_commander48 = require("commander");
|
|
6684
7465
|
|
|
6685
7466
|
// src/commands/nks/helpers.ts
|
|
6686
7467
|
var import_promises6 = require("fs/promises");
|
|
6687
7468
|
|
|
6688
7469
|
// src/services/nks/client.ts
|
|
6689
|
-
var
|
|
7470
|
+
var import_ky14 = __toESM(require("ky"));
|
|
6690
7471
|
|
|
6691
7472
|
// src/services/nks/types.ts
|
|
6692
7473
|
function isNksClusterSummary(val) {
|
|
@@ -6793,7 +7574,7 @@ var NksClient = class {
|
|
|
6793
7574
|
async supports() {
|
|
6794
7575
|
const url = `${this.nksEndpoint}/supports`;
|
|
6795
7576
|
try {
|
|
6796
|
-
const raw = await
|
|
7577
|
+
const raw = await import_ky14.default.get(url, {
|
|
6797
7578
|
headers: this.authHeaders(),
|
|
6798
7579
|
retry: 0,
|
|
6799
7580
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -6813,7 +7594,7 @@ var NksClient = class {
|
|
|
6813
7594
|
async listClusters() {
|
|
6814
7595
|
const url = `${this.nksEndpoint}/clusters`;
|
|
6815
7596
|
try {
|
|
6816
|
-
const raw = await
|
|
7597
|
+
const raw = await import_ky14.default.get(url, {
|
|
6817
7598
|
headers: this.authHeaders(),
|
|
6818
7599
|
retry: 0,
|
|
6819
7600
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -7121,7 +7902,7 @@ var NksClient = class {
|
|
|
7121
7902
|
async removeClusterAddon(cluster, addon) {
|
|
7122
7903
|
const url = `${this.nksEndpoint}/clusters/${encodeURIComponent(cluster)}/addons/${encodeURIComponent(addon)}`;
|
|
7123
7904
|
try {
|
|
7124
|
-
const raw = await
|
|
7905
|
+
const raw = await import_ky14.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS }).json();
|
|
7125
7906
|
if (!isNksUuidResponse(raw)) {
|
|
7126
7907
|
throw new NhnCloudCliError(
|
|
7127
7908
|
"nks cluster addon remove \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 uuid \uD544\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -7143,7 +7924,7 @@ var NksClient = class {
|
|
|
7143
7924
|
async getJson(path5, searchParams) {
|
|
7144
7925
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7145
7926
|
try {
|
|
7146
|
-
return await
|
|
7927
|
+
return await import_ky14.default.get(url, {
|
|
7147
7928
|
headers: this.authHeaders(),
|
|
7148
7929
|
searchParams,
|
|
7149
7930
|
retry: 0,
|
|
@@ -7164,10 +7945,10 @@ var NksClient = class {
|
|
|
7164
7945
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7165
7946
|
try {
|
|
7166
7947
|
if (method === "delete") {
|
|
7167
|
-
await
|
|
7948
|
+
await import_ky14.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
7168
7949
|
return;
|
|
7169
7950
|
}
|
|
7170
|
-
await
|
|
7951
|
+
await import_ky14.default.post(url, { headers: this.authHeaders(), json: payload, retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
7171
7952
|
} catch (err) {
|
|
7172
7953
|
throw toNhnCloudCliError(err);
|
|
7173
7954
|
}
|
|
@@ -7176,7 +7957,7 @@ var NksClient = class {
|
|
|
7176
7957
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7177
7958
|
try {
|
|
7178
7959
|
const options = { headers: this.authHeaders(), json: payload, retry: 0, timeout: DEFAULT_TIMEOUT_MS };
|
|
7179
|
-
return method === "post" ? await
|
|
7960
|
+
return method === "post" ? await import_ky14.default.post(url, options).json() : await import_ky14.default.patch(url, options).json();
|
|
7180
7961
|
} catch (err) {
|
|
7181
7962
|
throw toNhnCloudCliError(err);
|
|
7182
7963
|
}
|
|
@@ -7253,7 +8034,7 @@ function parseNonNegativeInteger(value, optionName) {
|
|
|
7253
8034
|
}
|
|
7254
8035
|
|
|
7255
8036
|
// src/commands/nks/supports.ts
|
|
7256
|
-
var supportsCommand = new
|
|
8037
|
+
var supportsCommand = new import_commander48.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) => {
|
|
7257
8038
|
const opts = cmd.optsWithGlobals();
|
|
7258
8039
|
const { client } = await resolveNksClient(opts);
|
|
7259
8040
|
startSpinner("NKS \uC9C0\uC6D0 \uC815\uBCF4 \uC870\uD68C \uC911...");
|
|
@@ -7278,9 +8059,9 @@ var supportsCommand = new import_commander44.Command("supports").description("NK
|
|
|
7278
8059
|
|
|
7279
8060
|
// src/commands/nks/cluster.ts
|
|
7280
8061
|
var import_promises7 = require("fs/promises");
|
|
7281
|
-
var
|
|
8062
|
+
var import_commander49 = require("commander");
|
|
7282
8063
|
var import_chalk14 = __toESM(require("chalk"));
|
|
7283
|
-
var
|
|
8064
|
+
var listCommand8 = new import_commander49.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) => {
|
|
7284
8065
|
const opts = cmd.optsWithGlobals();
|
|
7285
8066
|
const { client } = await resolveNksClient(opts);
|
|
7286
8067
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7386,7 +8167,7 @@ async function writeKubeconfigFile(path5, contents, force) {
|
|
|
7386
8167
|
throw err;
|
|
7387
8168
|
}
|
|
7388
8169
|
}
|
|
7389
|
-
var
|
|
8170
|
+
var createCommand6 = new import_commander49.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) => {
|
|
7390
8171
|
const opts = cmd.optsWithGlobals();
|
|
7391
8172
|
const payload = await readJsonFile(opts.file);
|
|
7392
8173
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7401,7 +8182,7 @@ var createCommand4 = new import_commander45.Command("create").description("NKS \
|
|
|
7401
8182
|
stopSpinner(true);
|
|
7402
8183
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC0DD\uC131");
|
|
7403
8184
|
});
|
|
7404
|
-
var
|
|
8185
|
+
var deleteCommand5 = new import_commander49.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) => {
|
|
7405
8186
|
const opts = cmd.optsWithGlobals();
|
|
7406
8187
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7407
8188
|
if (!ok) return;
|
|
@@ -7417,7 +8198,7 @@ var deleteCommand3 = new import_commander45.Command("delete").description("NKS \
|
|
|
7417
8198
|
process.stderr.write(import_chalk14.default.green(`\u2713 NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7418
8199
|
`));
|
|
7419
8200
|
});
|
|
7420
|
-
var resizeCommand2 = new
|
|
8201
|
+
var resizeCommand2 = new import_commander49.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) => {
|
|
7421
8202
|
const opts = cmd.optsWithGlobals();
|
|
7422
8203
|
const nodeCount = parsePositiveInteger(opts.nodeCount, "--node-count");
|
|
7423
8204
|
const nodesToRemove = opts.nodesToRemove?.split(",").map((node) => node.trim()).filter(Boolean);
|
|
@@ -7441,7 +8222,7 @@ var resizeCommand2 = new import_commander45.Command("resize").description("NKS \
|
|
|
7441
8222
|
stopSpinner(true);
|
|
7442
8223
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 resize");
|
|
7443
8224
|
});
|
|
7444
|
-
var setIpAclCommand = new
|
|
8225
|
+
var setIpAclCommand = new import_commander49.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) => {
|
|
7445
8226
|
const opts = cmd.optsWithGlobals();
|
|
7446
8227
|
const payload = await readJsonFile(opts.file);
|
|
7447
8228
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7456,7 +8237,7 @@ var setIpAclCommand = new import_commander45.Command("set-ipacl").description("N
|
|
|
7456
8237
|
stopSpinner(true);
|
|
7457
8238
|
uuidOutput(opts, result, "IP ACL \uC124\uC815");
|
|
7458
8239
|
});
|
|
7459
|
-
var renewCertificateCommand = new
|
|
8240
|
+
var renewCertificateCommand = new import_commander49.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) => {
|
|
7460
8241
|
const opts = cmd.optsWithGlobals();
|
|
7461
8242
|
const term = parsePositiveInteger(opts.termOfValidity, "--term-of-validity");
|
|
7462
8243
|
if (term < 1 || term > 5) {
|
|
@@ -7474,7 +8255,7 @@ var renewCertificateCommand = new import_commander45.Command("renew-certificate"
|
|
|
7474
8255
|
stopSpinner(true);
|
|
7475
8256
|
uuidOutput(opts, result, "\uC778\uC99D\uC11C \uAC31\uC2E0");
|
|
7476
8257
|
});
|
|
7477
|
-
var updateSgwCommand = new
|
|
8258
|
+
var updateSgwCommand = new import_commander49.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) => {
|
|
7478
8259
|
const opts = cmd.optsWithGlobals();
|
|
7479
8260
|
const { client } = await resolveNksClient(opts);
|
|
7480
8261
|
startSpinner("NKS \uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7488,7 +8269,7 @@ var updateSgwCommand = new import_commander45.Command("update-sgw").description(
|
|
|
7488
8269
|
stopSpinner(true);
|
|
7489
8270
|
uuidOutput(opts, result, "\uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD");
|
|
7490
8271
|
});
|
|
7491
|
-
var setControlPlaneLogCommand = new
|
|
8272
|
+
var setControlPlaneLogCommand = new import_commander49.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) => {
|
|
7492
8273
|
const opts = cmd.optsWithGlobals();
|
|
7493
8274
|
const controlPlaneLog = await readJsonFile(opts.file);
|
|
7494
8275
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7503,7 +8284,7 @@ var setControlPlaneLogCommand = new import_commander45.Command("set-control-plan
|
|
|
7503
8284
|
stopSpinner(true);
|
|
7504
8285
|
uuidOutput(opts, result, "control plane log \uC124\uC815");
|
|
7505
8286
|
});
|
|
7506
|
-
var
|
|
8287
|
+
var getCommand6 = new import_commander49.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) => {
|
|
7507
8288
|
const opts = cmd.optsWithGlobals();
|
|
7508
8289
|
const { client } = await resolveNksClient(opts);
|
|
7509
8290
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC870\uD68C \uC911...");
|
|
@@ -7522,7 +8303,7 @@ var getCommand4 = new import_commander45.Command("get").description("NKS \uD074\
|
|
|
7522
8303
|
ids: [resourceId(result)]
|
|
7523
8304
|
});
|
|
7524
8305
|
});
|
|
7525
|
-
var eventsCommand = new
|
|
8306
|
+
var eventsCommand = new import_commander49.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) => {
|
|
7526
8307
|
const opts = cmd.optsWithGlobals();
|
|
7527
8308
|
const { client } = await resolveNksClient(opts);
|
|
7528
8309
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uC870\uD68C \uC911...");
|
|
@@ -7543,7 +8324,7 @@ var eventsCommand = new import_commander45.Command("events").description("NKS \u
|
|
|
7543
8324
|
ids: events.map((event) => event.uuid)
|
|
7544
8325
|
});
|
|
7545
8326
|
});
|
|
7546
|
-
var eventCommand = new
|
|
8327
|
+
var eventCommand = new import_commander49.Command("event").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<event>", "\uC791\uC5C5 \uC774\uB825 UUID (\uC815\uC218 id \uAC00 \uC544\uB2C8\uB2E4)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, event, _opts, cmd) => {
|
|
7547
8328
|
const opts = cmd.optsWithGlobals();
|
|
7548
8329
|
if (!isUuid(event)) {
|
|
7549
8330
|
throw new NhnCloudCliError(
|
|
@@ -7572,7 +8353,7 @@ var eventCommand = new import_commander45.Command("event").description("NKS \uD0
|
|
|
7572
8353
|
ids: [result.uuid]
|
|
7573
8354
|
});
|
|
7574
8355
|
});
|
|
7575
|
-
var kubeconfigCommand = new
|
|
8356
|
+
var kubeconfigCommand = new import_commander49.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) => {
|
|
7576
8357
|
const opts = cmd.optsWithGlobals();
|
|
7577
8358
|
const { client } = await resolveNksClient(opts);
|
|
7578
8359
|
startSpinner("NKS kubeconfig \uC870\uD68C \uC911...");
|
|
@@ -7592,7 +8373,7 @@ var kubeconfigCommand = new import_commander45.Command("kubeconfig").description
|
|
|
7592
8373
|
}
|
|
7593
8374
|
process.stdout.write(kubeconfig.endsWith("\n") ? kubeconfig : kubeconfig + "\n");
|
|
7594
8375
|
});
|
|
7595
|
-
var ipAclCommand = new
|
|
8376
|
+
var ipAclCommand = new import_commander49.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) => {
|
|
7596
8377
|
const opts = cmd.optsWithGlobals();
|
|
7597
8378
|
const { client } = await resolveNksClient(opts);
|
|
7598
8379
|
startSpinner("NKS IP ACL \uC870\uD68C \uC911...");
|
|
@@ -7611,7 +8392,7 @@ var ipAclCommand = new import_commander45.Command("ipacl").description("NKS \uD0
|
|
|
7611
8392
|
ids: [result.cluster_uuid]
|
|
7612
8393
|
});
|
|
7613
8394
|
});
|
|
7614
|
-
var clusterAddonListCommand = new
|
|
8395
|
+
var clusterAddonListCommand = new import_commander49.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) => {
|
|
7615
8396
|
const opts = cmd.optsWithGlobals();
|
|
7616
8397
|
const { client } = await resolveNksClient(opts);
|
|
7617
8398
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7630,7 +8411,7 @@ var clusterAddonListCommand = new import_commander45.Command("list").description
|
|
|
7630
8411
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
7631
8412
|
});
|
|
7632
8413
|
});
|
|
7633
|
-
var clusterAddonGetCommand = new
|
|
8414
|
+
var clusterAddonGetCommand = new import_commander49.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) => {
|
|
7634
8415
|
const opts = cmd.optsWithGlobals();
|
|
7635
8416
|
const { client } = await resolveNksClient(opts);
|
|
7636
8417
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -7658,7 +8439,7 @@ function parseResolveConflicts(value) {
|
|
|
7658
8439
|
EXIT_PARAM_ERROR
|
|
7659
8440
|
);
|
|
7660
8441
|
}
|
|
7661
|
-
var clusterAddonInstallCommand = new
|
|
8442
|
+
var clusterAddonInstallCommand = new import_commander49.Command("install").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628\uC744 \uC124\uCE58\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").requiredOption("--name <name>", "\uC560\uB4DC\uC628 \uC774\uB984").requiredOption("--addon-version <version>", "\uC560\uB4DC\uC628 \uBC84\uC804").requiredOption("--resolve-conflicts <none|overwrite|preserve>", "\uCDA9\uB3CC \uD574\uACB0 \uC815\uCC45").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, _opts, cmd) => {
|
|
7662
8443
|
const opts = cmd.optsWithGlobals();
|
|
7663
8444
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7664
8445
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7677,7 +8458,7 @@ var clusterAddonInstallCommand = new import_commander45.Command("install").descr
|
|
|
7677
8458
|
stopSpinner(true);
|
|
7678
8459
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC124\uCE58");
|
|
7679
8460
|
});
|
|
7680
|
-
var clusterAddonUpdateCommand = new
|
|
8461
|
+
var clusterAddonUpdateCommand = new import_commander49.Command("update").description("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628\uC744 \uC5C5\uB370\uC774\uD2B8\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<addon>", "\uC560\uB4DC\uC628 UUID \uB610\uB294 \uC774\uB984").requiredOption("--addon-version <version>", "\uC560\uB4DC\uC628 \uBC84\uC804").requiredOption("--resolve-conflicts <none|overwrite|preserve>", "\uCDA9\uB3CC \uD574\uACB0 \uC815\uCC45").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, addon, _opts, cmd) => {
|
|
7681
8462
|
const opts = cmd.optsWithGlobals();
|
|
7682
8463
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7683
8464
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7695,7 +8476,7 @@ var clusterAddonUpdateCommand = new import_commander45.Command("update").descrip
|
|
|
7695
8476
|
stopSpinner(true);
|
|
7696
8477
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC5C5\uB370\uC774\uD2B8");
|
|
7697
8478
|
});
|
|
7698
|
-
var clusterAddonRemoveCommand = new
|
|
8479
|
+
var clusterAddonRemoveCommand = new import_commander49.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) => {
|
|
7699
8480
|
const opts = cmd.optsWithGlobals();
|
|
7700
8481
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 "${addon}" \uC744 \uC81C\uAC70\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7701
8482
|
if (!ok) return;
|
|
@@ -7711,11 +8492,11 @@ var clusterAddonRemoveCommand = new import_commander45.Command("remove").descrip
|
|
|
7711
8492
|
stopSpinner(true);
|
|
7712
8493
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC81C\uAC70");
|
|
7713
8494
|
});
|
|
7714
|
-
var clusterAddonCommand = new
|
|
7715
|
-
var clusterCommand = new
|
|
8495
|
+
var clusterAddonCommand = new import_commander49.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);
|
|
8496
|
+
var clusterCommand = new import_commander49.Command("cluster").description("NKS \uD074\uB7EC\uC2A4\uD130 \uAD00\uB828 \uBA85\uB839").addCommand(listCommand8).addCommand(getCommand6).addCommand(createCommand6).addCommand(deleteCommand5).addCommand(resizeCommand2).addCommand(eventsCommand).addCommand(eventCommand).addCommand(kubeconfigCommand).addCommand(ipAclCommand).addCommand(setIpAclCommand).addCommand(renewCertificateCommand).addCommand(updateSgwCommand).addCommand(setControlPlaneLogCommand).addCommand(clusterAddonCommand);
|
|
7716
8497
|
|
|
7717
8498
|
// src/commands/nks/nodegroup.ts
|
|
7718
|
-
var
|
|
8499
|
+
var import_commander50 = require("commander");
|
|
7719
8500
|
var import_chalk15 = __toESM(require("chalk"));
|
|
7720
8501
|
function nodeGroupRow(nodegroup) {
|
|
7721
8502
|
return [
|
|
@@ -7769,7 +8550,7 @@ async function confirmDangerousAction2(message, yes) {
|
|
|
7769
8550
|
if (!ok) process.stderr.write(import_chalk15.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7770
8551
|
return ok;
|
|
7771
8552
|
}
|
|
7772
|
-
var
|
|
8553
|
+
var listCommand9 = new import_commander50.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) => {
|
|
7773
8554
|
const opts = cmd.optsWithGlobals();
|
|
7774
8555
|
const { client } = await resolveNksClient(opts);
|
|
7775
8556
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7788,7 +8569,7 @@ var listCommand7 = new import_commander46.Command("list").description("NKS \uB17
|
|
|
7788
8569
|
ids: nodegroups.map((nodegroup) => nodegroup.uuid)
|
|
7789
8570
|
});
|
|
7790
8571
|
});
|
|
7791
|
-
var
|
|
8572
|
+
var getCommand7 = new import_commander50.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) => {
|
|
7792
8573
|
const opts = cmd.optsWithGlobals();
|
|
7793
8574
|
const { client } = await resolveNksClient(opts);
|
|
7794
8575
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uC870\uD68C \uC911...");
|
|
@@ -7807,7 +8588,7 @@ var getCommand5 = new import_commander46.Command("get").description("NKS \uB178\
|
|
|
7807
8588
|
ids: [result.uuid]
|
|
7808
8589
|
});
|
|
7809
8590
|
});
|
|
7810
|
-
var
|
|
8591
|
+
var createCommand7 = new import_commander50.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) => {
|
|
7811
8592
|
const opts = cmd.optsWithGlobals();
|
|
7812
8593
|
const payload = await readJsonFile(opts.file);
|
|
7813
8594
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7822,7 +8603,7 @@ var createCommand5 = new import_commander46.Command("create").description("NKS \
|
|
|
7822
8603
|
stopSpinner(true);
|
|
7823
8604
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 \uC0DD\uC131");
|
|
7824
8605
|
});
|
|
7825
|
-
var
|
|
8606
|
+
var deleteCommand6 = new import_commander50.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) => {
|
|
7826
8607
|
const opts = cmd.optsWithGlobals();
|
|
7827
8608
|
const ok = await confirmDangerousAction2(`NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7828
8609
|
if (!ok) return;
|
|
@@ -7839,7 +8620,7 @@ var deleteCommand4 = new import_commander46.Command("delete").description("NKS \
|
|
|
7839
8620
|
`));
|
|
7840
8621
|
});
|
|
7841
8622
|
function nodeActionCommand(name) {
|
|
7842
|
-
return new
|
|
8623
|
+
return new import_commander50.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) => {
|
|
7843
8624
|
const opts = cmd.optsWithGlobals();
|
|
7844
8625
|
const nodes = parseCsv(opts.nodes, "--nodes");
|
|
7845
8626
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7855,7 +8636,7 @@ function nodeActionCommand(name) {
|
|
|
7855
8636
|
uuidOutput2(opts, result, `\uB178\uB4DC ${name === "stop-node" ? "\uC911\uC9C0" : "\uC2DC\uC791"}`);
|
|
7856
8637
|
});
|
|
7857
8638
|
}
|
|
7858
|
-
var autoscaleCommand = new
|
|
8639
|
+
var autoscaleCommand = new import_commander50.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) => {
|
|
7859
8640
|
const opts = cmd.optsWithGlobals();
|
|
7860
8641
|
const { client } = await resolveNksClient(opts);
|
|
7861
8642
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC870\uD68C \uC911...");
|
|
@@ -7874,7 +8655,7 @@ var autoscaleCommand = new import_commander46.Command("autoscale").description("
|
|
|
7874
8655
|
ids: []
|
|
7875
8656
|
});
|
|
7876
8657
|
});
|
|
7877
|
-
var setAutoscaleCommand = new
|
|
8658
|
+
var setAutoscaleCommand = new import_commander50.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) => {
|
|
7878
8659
|
const opts = cmd.optsWithGlobals();
|
|
7879
8660
|
const payload = await readJsonFile(opts.file);
|
|
7880
8661
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7889,7 +8670,7 @@ var setAutoscaleCommand = new import_commander46.Command("set-autoscale").descri
|
|
|
7889
8670
|
stopSpinner(true);
|
|
7890
8671
|
uuidOutput2(opts, result, "autoscale \uBCC0\uACBD");
|
|
7891
8672
|
});
|
|
7892
|
-
var setMetricAutoscaleCommand = new
|
|
8673
|
+
var setMetricAutoscaleCommand = new import_commander50.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) => {
|
|
7893
8674
|
const opts = cmd.optsWithGlobals();
|
|
7894
8675
|
const payload = await readJsonFile(opts.file);
|
|
7895
8676
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7904,7 +8685,7 @@ var setMetricAutoscaleCommand = new import_commander46.Command("set-metric-autos
|
|
|
7904
8685
|
stopSpinner(true);
|
|
7905
8686
|
uuidOutput2(opts, result, "metric autoscale \uBCC0\uACBD");
|
|
7906
8687
|
});
|
|
7907
|
-
var upgradeCommand = new
|
|
8688
|
+
var upgradeCommand = new import_commander50.Command("upgrade").description("NKS \uB178\uB4DC \uADF8\uB8F9 Kubernetes version \uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD55C\uB2E4 (default-master \uB85C control plane \uC5C5\uADF8\uB808\uC774\uB4DC)").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984. control plane \uC740 default-master \uB85C \uC9C0\uC815\uD55C\uB2E4").requiredOption("--kube-version <v>", "\uB300\uC0C1 Kubernetes version").option("--num-buffer-nodes <n>", "\uCD95\uCD9C\uB41C \uD30C\uB4DC\uB97C \uBC1B\uC744 \uC5EC\uC720 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uC791\uC5C5 \uD6C4 \uC790\uB3D9 \uC0AD\uC81C, \uC778\uC2A4\uD134\uC2A4 \uC694\uAE08 \uBC1C\uC0DD)").option("--num-max-unavailable-nodes <n>", "\uD55C \uBC88\uC5D0 \uC11C\uBE44\uC2A4 \uBD88\uAC00 \uC0C1\uD0DC\uB85C \uB458 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uD06C\uBA74 \uBE60\uB974\uACE0 \uAC00\uC6A9\uC131 \uB0AE\uC74C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, nodegroup, _opts, cmd) => {
|
|
7908
8689
|
const opts = cmd.optsWithGlobals();
|
|
7909
8690
|
const { client } = await resolveNksClient(opts);
|
|
7910
8691
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 upgrade \uC694\uCCAD \uC911...");
|
|
@@ -7922,7 +8703,7 @@ var upgradeCommand = new import_commander46.Command("upgrade").description("NKS
|
|
|
7922
8703
|
stopSpinner(true);
|
|
7923
8704
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 upgrade");
|
|
7924
8705
|
});
|
|
7925
|
-
var setUserscriptCommand = new
|
|
8706
|
+
var setUserscriptCommand = new import_commander50.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) => {
|
|
7926
8707
|
const opts = cmd.optsWithGlobals();
|
|
7927
8708
|
const contents = await readTextFile(opts.file);
|
|
7928
8709
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7937,7 +8718,7 @@ var setUserscriptCommand = new import_commander46.Command("set-userscript").desc
|
|
|
7937
8718
|
stopSpinner(true);
|
|
7938
8719
|
uuidOutput2(opts, result, "user script \uBCC0\uACBD");
|
|
7939
8720
|
});
|
|
7940
|
-
var updateFlavorCommand = new
|
|
8721
|
+
var updateFlavorCommand = new import_commander50.Command("update-flavor").description("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uB97C \uBCC0\uACBD\uD55C\uB2E4").argument("<cluster>", "\uD074\uB7EC\uC2A4\uD130 UUID \uB610\uB294 \uC774\uB984").argument("<nodegroup>", "\uB178\uB4DC \uADF8\uB8F9 UUID \uB610\uB294 \uC774\uB984").requiredOption("--flavor <uuid>", "\uBCC0\uACBD\uD560 flavor UUID").option("--num-buffer-nodes <n>", "\uCD95\uCD9C\uB41C \uD30C\uB4DC\uB97C \uBC1B\uC744 \uC5EC\uC720 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uC791\uC5C5 \uD6C4 \uC790\uB3D9 \uC0AD\uC81C, \uC778\uC2A4\uD134\uC2A4 \uC694\uAE08 \uBC1C\uC0DD)").option("--num-max-unavailable-nodes <n>", "\uD55C \uBC88\uC5D0 \uC11C\uBE44\uC2A4 \uBD88\uAC00 \uC0C1\uD0DC\uB85C \uB458 \uB178\uB4DC \uC218 (\uAE30\uBCF8 1, \uD06C\uBA74 \uBE60\uB974\uACE0 \uAC00\uC6A9\uC131 \uB0AE\uC74C)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (cluster, nodegroup, _opts, cmd) => {
|
|
7941
8722
|
const opts = cmd.optsWithGlobals();
|
|
7942
8723
|
const { client } = await resolveNksClient(opts);
|
|
7943
8724
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7956,7 +8737,7 @@ var updateFlavorCommand = new import_commander46.Command("update-flavor").descri
|
|
|
7956
8737
|
uuidOutput2(opts, result, "flavor \uBCC0\uACBD");
|
|
7957
8738
|
});
|
|
7958
8739
|
function patchPayloadCommand(name) {
|
|
7959
|
-
return new
|
|
8740
|
+
return new import_commander50.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) => {
|
|
7960
8741
|
const opts = cmd.optsWithGlobals();
|
|
7961
8742
|
const payload = await readJsonFile(opts.file);
|
|
7962
8743
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7972,10 +8753,10 @@ function patchPayloadCommand(name) {
|
|
|
7972
8753
|
uuidOutput2(opts, result, name);
|
|
7973
8754
|
});
|
|
7974
8755
|
}
|
|
7975
|
-
var nodegroupCommand = new
|
|
8756
|
+
var nodegroupCommand = new import_commander50.Command("nodegroup").description("NKS \uB178\uB4DC \uADF8\uB8F9 \uAD00\uB828 \uBA85\uB839").addCommand(listCommand9).addCommand(getCommand7).addCommand(createCommand7).addCommand(deleteCommand6).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"));
|
|
7976
8757
|
|
|
7977
8758
|
// src/commands/nks/addon.ts
|
|
7978
|
-
var
|
|
8759
|
+
var import_commander51 = require("commander");
|
|
7979
8760
|
function addonTypeRow(addonType) {
|
|
7980
8761
|
return [
|
|
7981
8762
|
addonType.uuid ?? addonType.id ?? addonType.name,
|
|
@@ -7991,7 +8772,7 @@ function addonRow2(addon) {
|
|
|
7991
8772
|
addon.status ?? ""
|
|
7992
8773
|
];
|
|
7993
8774
|
}
|
|
7994
|
-
var addonTypeListCommand = new
|
|
8775
|
+
var addonTypeListCommand = new import_commander51.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) => {
|
|
7995
8776
|
const opts = cmd.optsWithGlobals();
|
|
7996
8777
|
const { client } = await resolveNksClient(opts);
|
|
7997
8778
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8010,7 +8791,7 @@ var addonTypeListCommand = new import_commander47.Command("list").description("N
|
|
|
8010
8791
|
ids: addonTypes.map((addonType) => addonType.uuid ?? addonType.id ?? addonType.name)
|
|
8011
8792
|
});
|
|
8012
8793
|
});
|
|
8013
|
-
var addonTypeGetCommand = new
|
|
8794
|
+
var addonTypeGetCommand = new import_commander51.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) => {
|
|
8014
8795
|
const opts = cmd.optsWithGlobals();
|
|
8015
8796
|
const { client } = await resolveNksClient(opts);
|
|
8016
8797
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uC870\uD68C \uC911...");
|
|
@@ -8029,8 +8810,8 @@ var addonTypeGetCommand = new import_commander47.Command("get").description("NKS
|
|
|
8029
8810
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
8030
8811
|
});
|
|
8031
8812
|
});
|
|
8032
|
-
var addonTypeCommand = new
|
|
8033
|
-
var addonListCommand = new
|
|
8813
|
+
var addonTypeCommand = new import_commander51.Command("addon-type").description("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uAD00\uB828 \uBA85\uB839").addCommand(addonTypeListCommand).addCommand(addonTypeGetCommand);
|
|
8814
|
+
var addonListCommand = new import_commander51.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) => {
|
|
8034
8815
|
const opts = cmd.optsWithGlobals();
|
|
8035
8816
|
const { client } = await resolveNksClient(opts);
|
|
8036
8817
|
startSpinner("NKS \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8053,7 +8834,7 @@ var addonListCommand = new import_commander47.Command("list").description("NKS \
|
|
|
8053
8834
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
8054
8835
|
});
|
|
8055
8836
|
});
|
|
8056
|
-
var addonGetCommand = new
|
|
8837
|
+
var addonGetCommand = new import_commander51.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) => {
|
|
8057
8838
|
const opts = cmd.optsWithGlobals();
|
|
8058
8839
|
const { client } = await resolveNksClient(opts);
|
|
8059
8840
|
startSpinner("NKS \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -8072,10 +8853,10 @@ var addonGetCommand = new import_commander47.Command("get").description("NKS \uC
|
|
|
8072
8853
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
8073
8854
|
});
|
|
8074
8855
|
});
|
|
8075
|
-
var addonCommand = new
|
|
8856
|
+
var addonCommand = new import_commander51.Command("addon").description("NKS \uC560\uB4DC\uC628 \uAD00\uB828 \uBA85\uB839").addCommand(addonListCommand).addCommand(addonGetCommand);
|
|
8076
8857
|
|
|
8077
8858
|
// src/commands/ncs/template.ts
|
|
8078
|
-
var
|
|
8859
|
+
var import_commander52 = require("commander");
|
|
8079
8860
|
var import_chalk16 = __toESM(require("chalk"));
|
|
8080
8861
|
|
|
8081
8862
|
// src/commands/ncs/helpers.ts
|
|
@@ -8249,7 +9030,7 @@ async function confirmDestructive(message, yes) {
|
|
|
8249
9030
|
}
|
|
8250
9031
|
|
|
8251
9032
|
// src/commands/ncs/template.ts
|
|
8252
|
-
var
|
|
9033
|
+
var listCommand10 = new import_commander52.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (_opts, cmd) => {
|
|
8253
9034
|
const opts = cmd.optsWithGlobals();
|
|
8254
9035
|
const { client } = await resolveNcsClient(opts);
|
|
8255
9036
|
startSpinner("NCS \uC124\uACC4\uB3C4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8280,7 +9061,7 @@ var listCommand8 = new import_commander48.Command("list").description("NCS \uC12
|
|
|
8280
9061
|
ids: templates.map((t) => t.id)
|
|
8281
9062
|
});
|
|
8282
9063
|
});
|
|
8283
|
-
var
|
|
9064
|
+
var getCommand8 = new import_commander52.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8284
9065
|
const opts = cmd.optsWithGlobals();
|
|
8285
9066
|
requireNonEmpty(id, "id");
|
|
8286
9067
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8308,7 +9089,7 @@ var getCommand6 = new import_commander48.Command("get").description("NCS \uC124\
|
|
|
8308
9089
|
ids: [template.id]
|
|
8309
9090
|
});
|
|
8310
9091
|
});
|
|
8311
|
-
var
|
|
9092
|
+
var createCommand8 = new import_commander52.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "template \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8312
9093
|
const opts = cmd.optsWithGlobals();
|
|
8313
9094
|
const payload = readJsonPayload(opts.file);
|
|
8314
9095
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8336,7 +9117,7 @@ var createCommand6 = new import_commander48.Command("create").description("NCS \
|
|
|
8336
9117
|
ids: [template.id]
|
|
8337
9118
|
});
|
|
8338
9119
|
});
|
|
8339
|
-
var
|
|
9120
|
+
var deleteCommand7 = new import_commander52.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8340
9121
|
const opts = cmd.optsWithGlobals();
|
|
8341
9122
|
requireNonEmpty(id, "id");
|
|
8342
9123
|
const ok = await confirmDestructive(`NCS \uC124\uACC4\uB3C4 "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
@@ -8356,7 +9137,7 @@ var deleteCommand5 = new import_commander48.Command("delete").description("NCS \
|
|
|
8356
9137
|
process.stderr.write(import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8357
9138
|
`));
|
|
8358
9139
|
});
|
|
8359
|
-
var versionListCommand = new
|
|
9140
|
+
var versionListCommand = new import_commander52.Command("list").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uBC84\uC804 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--q <query>", "\uAC80\uC0C9\uC5B4").option("--sort <sort>", "\uC815\uB82C \uC870\uAC74").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (id, _opts, cmd) => {
|
|
8360
9141
|
const opts = cmd.optsWithGlobals();
|
|
8361
9142
|
requireNonEmpty(id, "id");
|
|
8362
9143
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8389,7 +9170,7 @@ var versionListCommand = new import_commander48.Command("list").description("NCS
|
|
|
8389
9170
|
ids: versions.map((v) => v.id)
|
|
8390
9171
|
});
|
|
8391
9172
|
});
|
|
8392
|
-
var versionGetCommand = new
|
|
9173
|
+
var versionGetCommand = new import_commander52.Command("get").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
8393
9174
|
const opts = cmd.optsWithGlobals();
|
|
8394
9175
|
requireNonEmpty(id, "id");
|
|
8395
9176
|
requireNonEmpty(version, "version");
|
|
@@ -8410,7 +9191,7 @@ var versionGetCommand = new import_commander48.Command("get").description("NCS \
|
|
|
8410
9191
|
ids: [detail.id]
|
|
8411
9192
|
});
|
|
8412
9193
|
});
|
|
8413
|
-
var versionCreateCommand = new
|
|
9194
|
+
var versionCreateCommand = new import_commander52.Command("create").description("NCS \uC124\uACC4\uB3C4(template) \uC758 \uC0C8 \uBC84\uC804\uC744 \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, sourceVersion \uD544\uC218)").argument("<id>", "template ID").requiredOption("--file <path>", "\uBC84\uC804 \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C (sourceVersion \uD544\uB4DC \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8414
9195
|
const opts = cmd.optsWithGlobals();
|
|
8415
9196
|
requireNonEmpty(id, "id");
|
|
8416
9197
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8431,7 +9212,7 @@ var versionCreateCommand = new import_commander48.Command("create").description(
|
|
|
8431
9212
|
ids: [version.id]
|
|
8432
9213
|
});
|
|
8433
9214
|
});
|
|
8434
|
-
var versionDeleteCommand = new
|
|
9215
|
+
var versionDeleteCommand = new import_commander52.Command("delete").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "template ID").argument("<version>", "\uBC84\uC804 \uAC12").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, version, _opts, cmd) => {
|
|
8435
9216
|
const opts = cmd.optsWithGlobals();
|
|
8436
9217
|
requireNonEmpty(id, "id");
|
|
8437
9218
|
requireNonEmpty(version, "version");
|
|
@@ -8457,11 +9238,11 @@ var versionDeleteCommand = new import_commander48.Command("delete").description(
|
|
|
8457
9238
|
`)
|
|
8458
9239
|
);
|
|
8459
9240
|
});
|
|
8460
|
-
var versionCommand = new
|
|
8461
|
-
var templateCommand = new
|
|
9241
|
+
var versionCommand = new import_commander52.Command("version").description("NCS \uC124\uACC4\uB3C4(template) \uBC84\uC804 \uAD00\uB9AC").addCommand(versionListCommand).addCommand(versionGetCommand).addCommand(versionCreateCommand).addCommand(versionDeleteCommand);
|
|
9242
|
+
var templateCommand = new import_commander52.Command("template").description("NCS \uC124\uACC4\uB3C4(template) \uAD00\uB9AC").addCommand(listCommand10).addCommand(getCommand8).addCommand(createCommand8).addCommand(deleteCommand7).addCommand(versionCommand);
|
|
8462
9243
|
|
|
8463
9244
|
// src/commands/ncs/workload.ts
|
|
8464
|
-
var
|
|
9245
|
+
var import_commander53 = require("commander");
|
|
8465
9246
|
var import_chalk17 = __toESM(require("chalk"));
|
|
8466
9247
|
function workloadRows(w) {
|
|
8467
9248
|
return [
|
|
@@ -8476,7 +9257,7 @@ function workloadRows(w) {
|
|
|
8476
9257
|
];
|
|
8477
9258
|
}
|
|
8478
9259
|
var WORKLOAD_HEADERS = ["id", "name", "type", "status", "desired", "available"];
|
|
8479
|
-
var
|
|
9260
|
+
var listCommand11 = new import_commander53.Command("list").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--q <query>", "\uC6CC\uD06C\uB85C\uB4DC \uC774\uB984\xB7\uD15C\uD50C\uB9BF ID\xB7\uD15C\uD50C\uB9BF \uBC84\uC804\uC73C\uB85C \uD544\uD130\uB9C1").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").action(async (_opts, cmd) => {
|
|
8480
9261
|
const opts = cmd.optsWithGlobals();
|
|
8481
9262
|
const { client } = await resolveNcsClient(opts);
|
|
8482
9263
|
startSpinner("NCS workload \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8509,7 +9290,7 @@ var listCommand9 = new import_commander49.Command("list").description("NCS workl
|
|
|
8509
9290
|
ids: workloads.map((w) => w.id)
|
|
8510
9291
|
});
|
|
8511
9292
|
});
|
|
8512
|
-
var
|
|
9293
|
+
var getCommand9 = new import_commander53.Command("get").description("NCS workload \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8513
9294
|
const opts = cmd.optsWithGlobals();
|
|
8514
9295
|
requireNonEmpty(id, "id");
|
|
8515
9296
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8539,7 +9320,7 @@ var getCommand7 = new import_commander49.Command("get").description("NCS workloa
|
|
|
8539
9320
|
ids: [workload.id]
|
|
8540
9321
|
});
|
|
8541
9322
|
});
|
|
8542
|
-
var logsCommand = new
|
|
9323
|
+
var logsCommand = new import_commander53.Command("logs").description("NCS workload task \uC758 \uCEE8\uD14C\uC774\uB108 \uB85C\uADF8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").option("--container <name>", "\uCEE8\uD14C\uC774\uB108 \uC774\uB984 (\uD544\uC218)").option(
|
|
8543
9324
|
"--from <time>",
|
|
8544
9325
|
"\uB85C\uADF8 \uC2DC\uC791: \uC2DC\uAC04\uB300 \uD3EC\uD568 RFC3339, now \uB610\uB294 0 \uC774\uC0C1\uC758 \uC815\uC218\uC640 m/h/d \uB2E8\uC704 (\uC608: 30m, 1h, 2d). UTC Z\uB85C \uC815\uADDC\uD654\uD558\uBA70 \uC0DD\uB7B5 \uC2DC API \uAE30\uBCF8 \uBC94\uC704"
|
|
8545
9326
|
).option(
|
|
@@ -8584,7 +9365,7 @@ var logsCommand = new import_commander49.Command("logs").description("NCS worklo
|
|
|
8584
9365
|
ids: []
|
|
8585
9366
|
});
|
|
8586
9367
|
});
|
|
8587
|
-
var eventsCommand2 = new
|
|
9368
|
+
var eventsCommand2 = new import_commander53.Command("events").description("NCS workload task \uC758 \uC774\uBCA4\uD2B8\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").option("--type <type>", "\uC774\uBCA4\uD2B8 \uD0C0\uC785 (Normal | Warning)").option("--q <query>", "\uC774\uBCA4\uD2B8 \uB0B4\uC6A9 \uD544\uD130\uB9C1").option(
|
|
8588
9369
|
"--from <time>",
|
|
8589
9370
|
"\uC774\uBCA4\uD2B8 \uC2DC\uC791: \uC2DC\uAC04\uB300 \uD3EC\uD568 RFC3339, now \uB610\uB294 0 \uC774\uC0C1\uC758 \uC815\uC218\uC640 m/h/d \uB2E8\uC704 (\uC608: 30m, 1h, 2d). UTC Z\uB85C \uC815\uADDC\uD654\uD558\uBA70 \uC0DD\uB7B5 \uC2DC API \uAE30\uBCF8 \uBC94\uC704"
|
|
8590
9371
|
).option(
|
|
@@ -8626,7 +9407,7 @@ var eventsCommand2 = new import_commander49.Command("events").description("NCS w
|
|
|
8626
9407
|
ids: []
|
|
8627
9408
|
});
|
|
8628
9409
|
});
|
|
8629
|
-
var historyGetCommand = new
|
|
9410
|
+
var historyGetCommand = new import_commander53.Command("get").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uB2E8\uAC74\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, historyId, _opts, cmd) => {
|
|
8630
9411
|
const opts = cmd.optsWithGlobals();
|
|
8631
9412
|
requireNonEmpty(id, "id");
|
|
8632
9413
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8655,7 +9436,7 @@ var historyGetCommand = new import_commander49.Command("get").description("NCS w
|
|
|
8655
9436
|
ids: [String(detail.id)]
|
|
8656
9437
|
});
|
|
8657
9438
|
});
|
|
8658
|
-
var historyCommand = new
|
|
9439
|
+
var historyCommand = new import_commander53.Command("history").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--page <page>", "\uC870\uD68C\uD560 page \uBC88\uD638").option("--size <size>", "page \uB2F9 \uD56D\uBAA9 \uC218 (\uAE30\uBCF8: API \uAE30\uBCF8\uAC12 10)").option("--sort <sort>", "\uC815\uB82C \uAE30\uC900 \uD544\uB4DC\uBA85 (\uC5ED\uC21C\uC740 \uD544\uB4DC\uBA85 \uC55E\uC5D0 - \uB97C \uBD99\uC784, \uC608: -id)").action(async (id, _opts, cmd) => {
|
|
8659
9440
|
const opts = cmd.optsWithGlobals();
|
|
8660
9441
|
requireNonEmpty(id, "id");
|
|
8661
9442
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8688,7 +9469,7 @@ var historyCommand = new import_commander49.Command("history").description("NCS
|
|
|
8688
9469
|
ids: history.map((h) => String(h.id))
|
|
8689
9470
|
});
|
|
8690
9471
|
}).addCommand(historyGetCommand);
|
|
8691
|
-
var scheduleHistoryCommand = new
|
|
9472
|
+
var scheduleHistoryCommand = new import_commander53.Command("schedule-history").description("NCS workload \uC608\uC57D \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8692
9473
|
const opts = cmd.optsWithGlobals();
|
|
8693
9474
|
requireNonEmpty(id, "id");
|
|
8694
9475
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8709,7 +9490,7 @@ var scheduleHistoryCommand = new import_commander49.Command("schedule-history").
|
|
|
8709
9490
|
ids: scheduleHistory.map((s) => s.id)
|
|
8710
9491
|
});
|
|
8711
9492
|
});
|
|
8712
|
-
var
|
|
9493
|
+
var createCommand9 = new import_commander53.Command("create").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uB97C \uC0DD\uC131\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC)").requiredOption("--file <path>", "workload \uC0DD\uC131 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--wait", "workload \uAC00 Running \uC0C1\uD0DC\uAC00 \uB420 \uB54C\uAE4C\uC9C0 \uB300\uAE30").option("--timeout <sec>", "wait \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 300)", "300").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8713
9494
|
const opts = cmd.optsWithGlobals();
|
|
8714
9495
|
const payload = readJsonPayload(opts.file);
|
|
8715
9496
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
@@ -8740,7 +9521,7 @@ var createCommand7 = new import_commander49.Command("create").description("NCS w
|
|
|
8740
9521
|
ids: [workload.id]
|
|
8741
9522
|
});
|
|
8742
9523
|
});
|
|
8743
|
-
var
|
|
9524
|
+
var updateCommand2 = new import_commander53.Command("update").description("NCS workload \uB97C \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4 (--file \uB85C JSON spec \uC804\uB2EC, PUT)").argument("<id>", "workload ID").requiredOption("--file <path>", "workload \uAD50\uCCB4 spec \uC774 \uB2F4\uAE34 JSON \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8744
9525
|
const opts = cmd.optsWithGlobals();
|
|
8745
9526
|
requireNonEmpty(id, "id");
|
|
8746
9527
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8761,7 +9542,7 @@ var updateCommand = new import_commander49.Command("update").description("NCS wo
|
|
|
8761
9542
|
ids: [workload.id]
|
|
8762
9543
|
});
|
|
8763
9544
|
});
|
|
8764
|
-
var patchCommand = new
|
|
9545
|
+
var patchCommand = new import_commander53.Command("patch").description("NCS workload \uB97C \uBD80\uBD84 \uBCC0\uACBD\uD55C\uB2E4 (--file \uB85C JSON Patch \uBC30\uC5F4 \uC804\uB2EC, RFC 6902)").argument("<id>", "workload ID").requiredOption("--file <path>", "JSON Patch \uBC30\uC5F4(op/path/value)\uC774 \uB2F4\uAE34 \uD30C\uC77C \uACBD\uB85C").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8765
9546
|
const opts = cmd.optsWithGlobals();
|
|
8766
9547
|
requireNonEmpty(id, "id");
|
|
8767
9548
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8782,7 +9563,7 @@ var patchCommand = new import_commander49.Command("patch").description("NCS work
|
|
|
8782
9563
|
ids: [workload.id]
|
|
8783
9564
|
});
|
|
8784
9565
|
});
|
|
8785
|
-
var pauseCommand = new
|
|
9566
|
+
var pauseCommand = new import_commander53.Command("pause").description("NCS workload \uB97C \uC77C\uC2DC\uC815\uC9C0\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8786
9567
|
const opts = cmd.optsWithGlobals();
|
|
8787
9568
|
requireNonEmpty(id, "id");
|
|
8788
9569
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8797,7 +9578,7 @@ var pauseCommand = new import_commander49.Command("pause").description("NCS work
|
|
|
8797
9578
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC77C\uC2DC\uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8798
9579
|
`));
|
|
8799
9580
|
});
|
|
8800
|
-
var resumeCommand = new
|
|
9581
|
+
var resumeCommand = new import_commander53.Command("resume").description("NCS workload \uB97C \uC7AC\uAC1C\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8801
9582
|
const opts = cmd.optsWithGlobals();
|
|
8802
9583
|
requireNonEmpty(id, "id");
|
|
8803
9584
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8812,7 +9593,7 @@ var resumeCommand = new import_commander49.Command("resume").description("NCS wo
|
|
|
8812
9593
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC7AC\uAC1C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8813
9594
|
`));
|
|
8814
9595
|
});
|
|
8815
|
-
var restartCommand = new
|
|
9596
|
+
var restartCommand = new import_commander53.Command("restart").description("NCS workload task \uB97C \uC7AC\uC2DC\uC791\uD55C\uB2E4").argument("<id>", "workload ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").option("--task <taskId>", "task ID (\uD544\uC218)").action(async (id, _opts, cmd) => {
|
|
8816
9597
|
const opts = cmd.optsWithGlobals();
|
|
8817
9598
|
requireNonEmpty(id, "id");
|
|
8818
9599
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -8835,7 +9616,7 @@ var restartCommand = new import_commander49.Command("restart").description("NCS
|
|
|
8835
9616
|
`)
|
|
8836
9617
|
);
|
|
8837
9618
|
});
|
|
8838
|
-
var
|
|
9619
|
+
var deleteCommand8 = new import_commander53.Command("delete").description("NCS workload \uB97C \uC0AD\uC81C\uD55C\uB2E4").argument("<id>", "workload ID").option("--yes", "\uD655\uC778 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 (CI/\uBE44\uB300\uD654\uD615 \uD544\uC218)").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
8839
9620
|
const opts = cmd.optsWithGlobals();
|
|
8840
9621
|
requireNonEmpty(id, "id");
|
|
8841
9622
|
const ok = await confirmDestructive(`NCS workload "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
@@ -8855,10 +9636,10 @@ var deleteCommand6 = new import_commander49.Command("delete").description("NCS w
|
|
|
8855
9636
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8856
9637
|
`));
|
|
8857
9638
|
});
|
|
8858
|
-
var workloadCommand = new
|
|
9639
|
+
var workloadCommand = new import_commander53.Command("workload").description("NCS workload(\uB7F0\uD0C0\uC784 \uC2E4\uD589) \uAD00\uB9AC").addCommand(listCommand11).addCommand(getCommand9).addCommand(logsCommand).addCommand(eventsCommand2).addCommand(historyCommand).addCommand(scheduleHistoryCommand).addCommand(createCommand9).addCommand(updateCommand2).addCommand(patchCommand).addCommand(pauseCommand).addCommand(resumeCommand).addCommand(restartCommand).addCommand(deleteCommand8);
|
|
8859
9640
|
|
|
8860
9641
|
// src/commands/ncs/malware.ts
|
|
8861
|
-
var
|
|
9642
|
+
var import_commander54 = require("commander");
|
|
8862
9643
|
function parseEnabledOption(value) {
|
|
8863
9644
|
if (value === "true") return true;
|
|
8864
9645
|
if (value === "false") return false;
|
|
@@ -8867,7 +9648,7 @@ function parseEnabledOption(value) {
|
|
|
8867
9648
|
EXIT_PARAM_ERROR
|
|
8868
9649
|
);
|
|
8869
9650
|
}
|
|
8870
|
-
var configGetCommand = new
|
|
9651
|
+
var configGetCommand = new import_commander54.Command("get").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8871
9652
|
const opts = cmd.optsWithGlobals();
|
|
8872
9653
|
const { client } = await resolveNcsClient(opts);
|
|
8873
9654
|
startSpinner("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uC870\uD68C \uC911...");
|
|
@@ -8886,7 +9667,7 @@ var configGetCommand = new import_commander50.Command("get").description("NCS \u
|
|
|
8886
9667
|
ids: []
|
|
8887
9668
|
});
|
|
8888
9669
|
});
|
|
8889
|
-
var configSetCommand = new
|
|
9670
|
+
var configSetCommand = new import_commander54.Command("set").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815\uC744 \uBCC0\uACBD\uD55C\uB2E4").requiredOption("--enabled <true|false>", "\uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC0AC\uC6A9 \uC5EC\uBD80").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
8890
9671
|
const opts = cmd.optsWithGlobals();
|
|
8891
9672
|
const enabled = parseEnabledOption(opts.enabled);
|
|
8892
9673
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8906,8 +9687,8 @@ var configSetCommand = new import_commander50.Command("set").description("NCS \u
|
|
|
8906
9687
|
ids: []
|
|
8907
9688
|
});
|
|
8908
9689
|
});
|
|
8909
|
-
var configCommand = new
|
|
8910
|
-
var resultCommand = new
|
|
9690
|
+
var configCommand = new import_commander54.Command("config").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uAD00\uB9AC").addCommand(configGetCommand).addCommand(configSetCommand);
|
|
9691
|
+
var resultCommand = new import_commander54.Command("result").description("NCS workload \uC2E4\uD589 \uD788\uC2A4\uD1A0\uB9AC\uC758 \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<workloadId>", "workload ID").argument("<historyId>", "\uD788\uC2A4\uD1A0\uB9AC ID").option("--region <region>", "NCS region (\uAE30\uBCF8: kr1, kr1/kr3 \uB9CC \uC9C0\uC6D0)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (workloadId, historyId, _opts, cmd) => {
|
|
8911
9692
|
const opts = cmd.optsWithGlobals();
|
|
8912
9693
|
requireNonEmpty(workloadId, "workloadId");
|
|
8913
9694
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8938,16 +9719,16 @@ var resultCommand = new import_commander50.Command("result").description("NCS wo
|
|
|
8938
9719
|
ids: []
|
|
8939
9720
|
});
|
|
8940
9721
|
});
|
|
8941
|
-
var malwareCommand = new
|
|
9722
|
+
var malwareCommand = new import_commander54.Command("malware").description("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uAD00\uB9AC").addCommand(configCommand).addCommand(resultCommand);
|
|
8942
9723
|
|
|
8943
9724
|
// src/commands/apigateway/service.ts
|
|
8944
|
-
var
|
|
9725
|
+
var import_commander55 = require("commander");
|
|
8945
9726
|
|
|
8946
9727
|
// src/commands/apigateway/helpers.ts
|
|
8947
9728
|
var import_promises8 = require("fs/promises");
|
|
8948
9729
|
|
|
8949
9730
|
// src/services/apigateway/client.ts
|
|
8950
|
-
var
|
|
9731
|
+
var import_ky15 = __toESM(require("ky"));
|
|
8951
9732
|
|
|
8952
9733
|
// src/services/apigateway/types.ts
|
|
8953
9734
|
function isApiGatewayService(value) {
|
|
@@ -9064,7 +9845,7 @@ var ApiGatewayClient = class {
|
|
|
9064
9845
|
let page = params.page ?? 1;
|
|
9065
9846
|
try {
|
|
9066
9847
|
while (true) {
|
|
9067
|
-
const response = await
|
|
9848
|
+
const response = await import_ky15.default.get(`${this.baseUrl}/services`, {
|
|
9068
9849
|
headers: this.authHeaders(),
|
|
9069
9850
|
searchParams: { page, limit },
|
|
9070
9851
|
retry: 0,
|
|
@@ -9104,7 +9885,7 @@ var ApiGatewayClient = class {
|
|
|
9104
9885
|
/** API Gateway service 한 건을 조회한다. */
|
|
9105
9886
|
async getService(apigwServiceId) {
|
|
9106
9887
|
try {
|
|
9107
|
-
const response = await
|
|
9888
|
+
const response = await import_ky15.default.get(`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}`, {
|
|
9108
9889
|
headers: this.authHeaders(),
|
|
9109
9890
|
retry: 0,
|
|
9110
9891
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -9125,7 +9906,7 @@ var ApiGatewayClient = class {
|
|
|
9125
9906
|
/** paging 없이 API Gateway resource 전체를 한 번에 조회한다. */
|
|
9126
9907
|
async listResources(apigwServiceId) {
|
|
9127
9908
|
try {
|
|
9128
|
-
const response = await
|
|
9909
|
+
const response = await import_ky15.default.get(
|
|
9129
9910
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources`,
|
|
9130
9911
|
{
|
|
9131
9912
|
headers: this.authHeaders(),
|
|
@@ -9149,7 +9930,7 @@ var ApiGatewayClient = class {
|
|
|
9149
9930
|
/** API Gateway resource 경로 플러그인을 upsert한다. */
|
|
9150
9931
|
async setPathPlugins(apigwServiceId, resourceId2, pathPluginList) {
|
|
9151
9932
|
try {
|
|
9152
|
-
const response = await
|
|
9933
|
+
const response = await import_ky15.default.put(
|
|
9153
9934
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resource-paths/${encodeURIComponent(resourceId2)}`,
|
|
9154
9935
|
{
|
|
9155
9936
|
headers: this.authHeaders(),
|
|
@@ -9174,7 +9955,7 @@ var ApiGatewayClient = class {
|
|
|
9174
9955
|
/** API Gateway resource 메서드 플러그인을 upsert한다. */
|
|
9175
9956
|
async setMethodPlugins(apigwServiceId, resourceId2, body) {
|
|
9176
9957
|
try {
|
|
9177
|
-
const response = await
|
|
9958
|
+
const response = await import_ky15.default.put(
|
|
9178
9959
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resource-methods/${encodeURIComponent(resourceId2)}`,
|
|
9179
9960
|
{
|
|
9180
9961
|
headers: this.authHeaders(),
|
|
@@ -9199,7 +9980,7 @@ var ApiGatewayClient = class {
|
|
|
9199
9980
|
/** API Gateway resource 요청 parameter를 조회한다. */
|
|
9200
9981
|
async getResourceParameters(apigwServiceId, resourceId2) {
|
|
9201
9982
|
try {
|
|
9202
|
-
const response = await
|
|
9983
|
+
const response = await import_ky15.default.get(
|
|
9203
9984
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources/${encodeURIComponent(resourceId2)}/parameters`,
|
|
9204
9985
|
{
|
|
9205
9986
|
headers: this.authHeaders(),
|
|
@@ -9229,7 +10010,7 @@ var ApiGatewayClient = class {
|
|
|
9229
10010
|
/** API Gateway resource 응답 정의를 조회한다. */
|
|
9230
10011
|
async getResourceResponses(apigwServiceId, resourceId2) {
|
|
9231
10012
|
try {
|
|
9232
|
-
const response = await
|
|
10013
|
+
const response = await import_ky15.default.get(
|
|
9233
10014
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources/${encodeURIComponent(resourceId2)}/responses`,
|
|
9234
10015
|
{
|
|
9235
10016
|
headers: this.authHeaders(),
|
|
@@ -9260,7 +10041,7 @@ var ApiGatewayClient = class {
|
|
|
9260
10041
|
let page = 1;
|
|
9261
10042
|
try {
|
|
9262
10043
|
while (true) {
|
|
9263
|
-
const response = await
|
|
10044
|
+
const response = await import_ky15.default.get(
|
|
9264
10045
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages`,
|
|
9265
10046
|
{
|
|
9266
10047
|
headers: this.authHeaders(),
|
|
@@ -9303,7 +10084,7 @@ var ApiGatewayClient = class {
|
|
|
9303
10084
|
/** API Gateway stage의 backend endpoint와 설명을 수정한다. */
|
|
9304
10085
|
async updateStage(apigwServiceId, stageId, body) {
|
|
9305
10086
|
try {
|
|
9306
|
-
const response = await
|
|
10087
|
+
const response = await import_ky15.default.put(
|
|
9307
10088
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}`,
|
|
9308
10089
|
{
|
|
9309
10090
|
headers: this.authHeaders(),
|
|
@@ -9328,7 +10109,7 @@ var ApiGatewayClient = class {
|
|
|
9328
10109
|
/** 사용자 정의 Swagger 객체를 내부 해석 없이 반환한다. */
|
|
9329
10110
|
async getStageSwagger(apigwServiceId, stageId) {
|
|
9330
10111
|
try {
|
|
9331
|
-
const response = await
|
|
10112
|
+
const response = await import_ky15.default.get(
|
|
9332
10113
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/swagger`,
|
|
9333
10114
|
{
|
|
9334
10115
|
headers: this.authHeaders(),
|
|
@@ -9352,7 +10133,7 @@ var ApiGatewayClient = class {
|
|
|
9352
10133
|
/** paging 없이 배포된 API Gateway stage resource 전체를 한 번에 조회한다. */
|
|
9353
10134
|
async listStageResources(apigwServiceId, stageId) {
|
|
9354
10135
|
try {
|
|
9355
|
-
const response = await
|
|
10136
|
+
const response = await import_ky15.default.get(
|
|
9356
10137
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/resources`,
|
|
9357
10138
|
{
|
|
9358
10139
|
headers: this.authHeaders(),
|
|
@@ -9376,7 +10157,7 @@ var ApiGatewayClient = class {
|
|
|
9376
10157
|
/** API Gateway service resource를 stage에 반영한다. */
|
|
9377
10158
|
async importStageResources(apigwServiceId, stageId) {
|
|
9378
10159
|
try {
|
|
9379
|
-
const response = await
|
|
10160
|
+
const response = await import_ky15.default.put(
|
|
9380
10161
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/resources`,
|
|
9381
10162
|
{
|
|
9382
10163
|
headers: this.authHeaders(),
|
|
@@ -9401,7 +10182,7 @@ var ApiGatewayClient = class {
|
|
|
9401
10182
|
async createDeploy(apigwServiceId, stageId, body) {
|
|
9402
10183
|
const json = body.deployDescription === void 0 ? {} : { deployDescription: body.deployDescription };
|
|
9403
10184
|
try {
|
|
9404
|
-
const response = await
|
|
10185
|
+
const response = await import_ky15.default.post(
|
|
9405
10186
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys`,
|
|
9406
10187
|
{
|
|
9407
10188
|
headers: this.authHeaders(),
|
|
@@ -9419,7 +10200,7 @@ var ApiGatewayClient = class {
|
|
|
9419
10200
|
/** 배포 이력의 설정으로 API Gateway stage를 롤백한다. */
|
|
9420
10201
|
async rollbackDeploy(apigwServiceId, stageId, deployId) {
|
|
9421
10202
|
try {
|
|
9422
|
-
const response = await
|
|
10203
|
+
const response = await import_ky15.default.post(
|
|
9423
10204
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys/${encodeURIComponent(deployId)}/rollback`,
|
|
9424
10205
|
{
|
|
9425
10206
|
headers: this.authHeaders(),
|
|
@@ -9447,7 +10228,7 @@ var ApiGatewayClient = class {
|
|
|
9447
10228
|
let page = 1;
|
|
9448
10229
|
try {
|
|
9449
10230
|
while (true) {
|
|
9450
|
-
const response = await
|
|
10231
|
+
const response = await import_ky15.default.get(
|
|
9451
10232
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys`,
|
|
9452
10233
|
{
|
|
9453
10234
|
headers: this.authHeaders(),
|
|
@@ -9490,7 +10271,7 @@ var ApiGatewayClient = class {
|
|
|
9490
10271
|
/** API Gateway stage 최신 배포 결과를 조회한다. */
|
|
9491
10272
|
async getLatestDeploy(apigwServiceId, stageId) {
|
|
9492
10273
|
try {
|
|
9493
|
-
const response = await
|
|
10274
|
+
const response = await import_ky15.default.get(
|
|
9494
10275
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys/latest`,
|
|
9495
10276
|
{
|
|
9496
10277
|
headers: this.authHeaders(),
|
|
@@ -9546,7 +10327,7 @@ function fileErrorReason(error) {
|
|
|
9546
10327
|
}
|
|
9547
10328
|
return error instanceof Error ? error.message : String(error);
|
|
9548
10329
|
}
|
|
9549
|
-
function
|
|
10330
|
+
function requireYes2(yes, operation) {
|
|
9550
10331
|
if (!yes) {
|
|
9551
10332
|
throw new NhnCloudCliError(
|
|
9552
10333
|
`${operation}\uC5D0\uB294 --yes \uD50C\uB798\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`,
|
|
@@ -9642,7 +10423,7 @@ async function resolveApiGatewayClient(opts) {
|
|
|
9642
10423
|
}
|
|
9643
10424
|
|
|
9644
10425
|
// src/commands/apigateway/service.ts
|
|
9645
|
-
var
|
|
10426
|
+
var listCommand12 = new import_commander55.Command("list").description("API Gateway service \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, command) => {
|
|
9646
10427
|
const opts = command.optsWithGlobals();
|
|
9647
10428
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9648
10429
|
startSpinner("API Gateway service \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -9673,7 +10454,7 @@ var listCommand10 = new import_commander51.Command("list").description("API Gate
|
|
|
9673
10454
|
ids: services.map((service) => sanitizeForTerminal(service.apigwServiceId))
|
|
9674
10455
|
});
|
|
9675
10456
|
});
|
|
9676
|
-
var
|
|
10457
|
+
var getCommand10 = new import_commander55.Command("get").description("API Gateway service \uD55C \uAC74\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (serviceId, _opts, command) => {
|
|
9677
10458
|
const opts = command.optsWithGlobals();
|
|
9678
10459
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
9679
10460
|
const displayServiceId = sanitizeForTerminal(parsedServiceId);
|
|
@@ -9706,10 +10487,10 @@ var getCommand8 = new import_commander51.Command("get").description("API Gateway
|
|
|
9706
10487
|
ids: [sanitizeForTerminal(service.apigwServiceId)]
|
|
9707
10488
|
});
|
|
9708
10489
|
});
|
|
9709
|
-
var serviceCommand = new
|
|
10490
|
+
var serviceCommand = new import_commander55.Command("service").description("API Gateway service \uC870\uD68C \uBA85\uB839").addCommand(listCommand12).addCommand(getCommand10);
|
|
9710
10491
|
|
|
9711
10492
|
// src/commands/apigateway/resource.ts
|
|
9712
|
-
var
|
|
10493
|
+
var import_commander56 = require("commander");
|
|
9713
10494
|
function addApiGatewayOptions(command) {
|
|
9714
10495
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
9715
10496
|
}
|
|
@@ -9790,8 +10571,8 @@ function updatedResourceOutput(opts, resources) {
|
|
|
9790
10571
|
ids: resources.map((resource) => sanitizeForTerminal(resource.resourceId))
|
|
9791
10572
|
});
|
|
9792
10573
|
}
|
|
9793
|
-
var
|
|
9794
|
-
new
|
|
10574
|
+
var listCommand13 = addApiGatewayOptions(
|
|
10575
|
+
new import_commander56.Command("list").description("API Gateway resource \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID")
|
|
9795
10576
|
).action(async (serviceId, _opts, command) => {
|
|
9796
10577
|
const opts = command.optsWithGlobals();
|
|
9797
10578
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9820,7 +10601,7 @@ var listCommand11 = addApiGatewayOptions(
|
|
|
9820
10601
|
});
|
|
9821
10602
|
});
|
|
9822
10603
|
var parametersCommand = addApiGatewayOptions(
|
|
9823
|
-
new
|
|
10604
|
+
new import_commander56.Command("parameters").description("API Gateway resource \uC694\uCCAD parameter\uB97C \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID")
|
|
9824
10605
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9825
10606
|
const opts = command.optsWithGlobals();
|
|
9826
10607
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9849,7 +10630,7 @@ var parametersCommand = addApiGatewayOptions(
|
|
|
9849
10630
|
});
|
|
9850
10631
|
});
|
|
9851
10632
|
var responsesCommand = addApiGatewayOptions(
|
|
9852
|
-
new
|
|
10633
|
+
new import_commander56.Command("responses").description("API Gateway resource \uC751\uB2F5 \uC815\uC758\uB97C \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID")
|
|
9853
10634
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9854
10635
|
const opts = command.optsWithGlobals();
|
|
9855
10636
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9875,7 +10656,7 @@ var responsesCommand = addApiGatewayOptions(
|
|
|
9875
10656
|
});
|
|
9876
10657
|
});
|
|
9877
10658
|
var setPathPluginCommand = addApiGatewayOptions(
|
|
9878
|
-
new
|
|
10659
|
+
new import_commander56.Command("set-path-plugin").description("API Gateway resource \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778\uC744 \uC124\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID").requiredOption("--config-file <path>", "\uD50C\uB7EC\uADF8\uC778 \uC124\uC815 JSON \uD30C\uC77C").option("--dry-run", "\uC4F0\uAE30 \uC5C6\uC774 \uC608\uC0C1 \uC601\uD5A5 \uBC94\uC704\uB97C \uCD9C\uB825\uD55C\uB2E4").option("--yes", "\uB9AC\uC18C\uC2A4 \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC124\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
9879
10660
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9880
10661
|
const opts = command.optsWithGlobals();
|
|
9881
10662
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9891,7 +10672,7 @@ var setPathPluginCommand = addApiGatewayOptions(
|
|
|
9891
10672
|
"\uACBD\uACE0: applyChildPath\uC640 delete\uAC00 \uD568\uAED8 true\uC774\uBA74 \uD558\uC704 \uC804\uCCB4\uC5D0\uC11C \uD574\uB2F9 \uD50C\uB7EC\uADF8\uC778\uC774 \uC0AD\uC81C\uB429\uB2C8\uB2E4.\n"
|
|
9892
10673
|
);
|
|
9893
10674
|
}
|
|
9894
|
-
if (!opts.dryRun)
|
|
10675
|
+
if (!opts.dryRun) requireYes2(opts.yes, "\uB9AC\uC18C\uC2A4 \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC124\uC815");
|
|
9895
10676
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9896
10677
|
const displayResourceId = sanitizeForTerminal(parsedResourceId);
|
|
9897
10678
|
const spinnerAction = opts.dryRun ? "\uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC601\uD5A5 \uBC94\uC704 \uD655\uC778" : "\uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC124\uC815";
|
|
@@ -9949,13 +10730,13 @@ var setPathPluginCommand = addApiGatewayOptions(
|
|
|
9949
10730
|
updatedResourceOutput(opts, updatedResources);
|
|
9950
10731
|
});
|
|
9951
10732
|
var setMethodPluginCommand = addApiGatewayOptions(
|
|
9952
|
-
new
|
|
10733
|
+
new import_commander56.Command("set-method-plugin").description("API Gateway resource \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778\uC744 \uC124\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<resource-id>", "API Gateway resource ID").requiredOption("--config-file <path>", "\uD50C\uB7EC\uADF8\uC778 \uC124\uC815 JSON \uD30C\uC77C").option("--dry-run", "\uC4F0\uAE30 \uC5C6\uC774 \uC608\uC0C1 \uBCC0\uACBD \uB0B4\uC6A9\uC744 \uCD9C\uB825\uD55C\uB2E4").option("--yes", "\uB9AC\uC18C\uC2A4 \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC124\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
9953
10734
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9954
10735
|
const opts = command.optsWithGlobals();
|
|
9955
10736
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
9956
10737
|
const parsedResourceId = parseRequiredArgument(resourceId2, "resource-id");
|
|
9957
10738
|
const config = parseMethodPluginConfig(await readPluginConfigFile(opts.configFile));
|
|
9958
|
-
if (!opts.dryRun)
|
|
10739
|
+
if (!opts.dryRun) requireYes2(opts.yes, "\uB9AC\uC18C\uC2A4 \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC124\uC815");
|
|
9959
10740
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9960
10741
|
const displayResourceId = sanitizeForTerminal(parsedResourceId);
|
|
9961
10742
|
const spinnerAction = opts.dryRun ? "\uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC601\uD5A5 \uBC94\uC704 \uD655\uC778" : "\uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC124\uC815";
|
|
@@ -10037,19 +10818,19 @@ var setMethodPluginCommand = addApiGatewayOptions(
|
|
|
10037
10818
|
}
|
|
10038
10819
|
updatedResourceOutput(opts, updatedResources);
|
|
10039
10820
|
});
|
|
10040
|
-
var resourceCommand = new
|
|
10821
|
+
var resourceCommand = new import_commander56.Command("resource").description("API Gateway resource \uC870\uD68C \uBC0F \uBCC0\uACBD \uBA85\uB839").addCommand(listCommand13).addCommand(parametersCommand).addCommand(responsesCommand).addCommand(setPathPluginCommand).addCommand(setMethodPluginCommand);
|
|
10041
10822
|
|
|
10042
10823
|
// src/commands/apigateway/stage.ts
|
|
10043
10824
|
var import_promises9 = require("fs/promises");
|
|
10044
|
-
var
|
|
10825
|
+
var import_commander58 = require("commander");
|
|
10045
10826
|
|
|
10046
10827
|
// src/commands/apigateway/deploy.ts
|
|
10047
|
-
var
|
|
10828
|
+
var import_commander57 = require("commander");
|
|
10048
10829
|
function addApiGatewayOptions2(command) {
|
|
10049
10830
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
10050
10831
|
}
|
|
10051
|
-
var
|
|
10052
|
-
new
|
|
10832
|
+
var listCommand14 = addApiGatewayOptions2(
|
|
10833
|
+
new import_commander57.Command("list").description("API Gateway stage \uBC30\uD3EC \uC774\uB825 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
10053
10834
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10054
10835
|
const opts = command.optsWithGlobals();
|
|
10055
10836
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10078,7 +10859,7 @@ var listCommand12 = addApiGatewayOptions2(
|
|
|
10078
10859
|
});
|
|
10079
10860
|
});
|
|
10080
10861
|
var latestCommand = addApiGatewayOptions2(
|
|
10081
|
-
new
|
|
10862
|
+
new import_commander57.Command("latest").description("API Gateway stage \uCD5C\uC2E0 \uBC30\uD3EC \uACB0\uACFC\uB97C \uC870\uD68C\uD55C\uB2E4 (resource \uC804\uCCB4\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
10082
10863
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10083
10864
|
const opts = command.optsWithGlobals();
|
|
10084
10865
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10107,8 +10888,8 @@ var latestCommand = addApiGatewayOptions2(
|
|
|
10107
10888
|
ids: [sanitizeForTerminal(deploy.deployId)]
|
|
10108
10889
|
});
|
|
10109
10890
|
});
|
|
10110
|
-
var
|
|
10111
|
-
new
|
|
10891
|
+
var createCommand10 = addApiGatewayOptions2(
|
|
10892
|
+
new import_commander57.Command("create").description("stage \uC124\uC815\uC744 API Gateway service \uC5D0 \uBC30\uD3EC\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--description <text>", "\uBC30\uD3EC \uC124\uBA85 (\uCD5C\uB300 200\uC790)").option("--no-wait", "\uBC30\uD3EC \uACB0\uACFC\uB97C \uAE30\uB2E4\uB9AC\uC9C0 \uC54A\uACE0 \uC694\uCCAD\uB9CC \uD55C\uB2E4").option("--timeout <sec>", "\uBC30\uD3EC \uB300\uAE30 \uC0C1\uD55C (\uCD08, \uAE30\uBCF8 300)", "300").option("--yes", "\uBC30\uD3EC\uB97C \uD655\uC778\uD55C\uB2E4")
|
|
10112
10893
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10113
10894
|
const opts = command.optsWithGlobals();
|
|
10114
10895
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10126,7 +10907,7 @@ var createCommand8 = addApiGatewayOptions2(
|
|
|
10126
10907
|
);
|
|
10127
10908
|
}
|
|
10128
10909
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
10129
|
-
|
|
10910
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uBC30\uD3EC");
|
|
10130
10911
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10131
10912
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10132
10913
|
let baselineDeployId = null;
|
|
@@ -10206,13 +10987,13 @@ var createCommand8 = addApiGatewayOptions2(
|
|
|
10206
10987
|
});
|
|
10207
10988
|
});
|
|
10208
10989
|
var rollbackCommand = addApiGatewayOptions2(
|
|
10209
|
-
new
|
|
10990
|
+
new import_commander57.Command("rollback").description("\uBC30\uD3EC \uC774\uB825\uC73C\uB85C stage \uC124\uC815\uC744 \uB418\uB3CC\uB9B0\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").argument("<deploy-id>", "\uB418\uB3CC\uB9B4 \uBC30\uD3EC ID").option("--yes", "\uB418\uB3CC\uB9AC\uAE30\uB97C \uD655\uC778\uD55C\uB2E4")
|
|
10210
10991
|
).action(async (serviceId, stageId, deployId, _opts, command) => {
|
|
10211
10992
|
const opts = command.optsWithGlobals();
|
|
10212
10993
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
10213
10994
|
const parsedStageId = parseRequiredArgument(stageId, "stage-id");
|
|
10214
10995
|
const parsedDeployId = parseRequiredArgument(deployId, "deploy-id");
|
|
10215
|
-
|
|
10996
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uB418\uB3CC\uB9AC\uAE30");
|
|
10216
10997
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10217
10998
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10218
10999
|
startSpinner(`API Gateway stage "${displayStageId}" \uB418\uB3CC\uB9AC\uB294 \uC911...`);
|
|
@@ -10234,7 +11015,7 @@ var rollbackCommand = addApiGatewayOptions2(
|
|
|
10234
11015
|
);
|
|
10235
11016
|
process.stderr.write("\uC644\uB8CC: \uC9C1\uC804\uAE4C\uC9C0\uC758 \uC2A4\uD14C\uC774\uC9C0 \uC124\uC815\uC740 \uC774 \uBC30\uD3EC \uC774\uB825\uC758 \uB0B4\uC6A9\uC73C\uB85C \uB300\uCCB4\uB410\uC2B5\uB2C8\uB2E4.\n");
|
|
10236
11017
|
});
|
|
10237
|
-
var deployCommand = new
|
|
11018
|
+
var deployCommand = new import_commander57.Command("deploy").description("API Gateway stage \uBC30\uD3EC \uC870\uD68C\uC640 \uC2E4\uD589 \uBA85\uB839").addCommand(listCommand14).addCommand(latestCommand).addCommand(createCommand10).addCommand(rollbackCommand);
|
|
10238
11019
|
|
|
10239
11020
|
// src/commands/apigateway/stage.ts
|
|
10240
11021
|
function addApiGatewayOptions3(command) {
|
|
@@ -10262,8 +11043,8 @@ async function writeStageSwaggerFile(path5, swagger, force) {
|
|
|
10262
11043
|
);
|
|
10263
11044
|
}
|
|
10264
11045
|
}
|
|
10265
|
-
var
|
|
10266
|
-
new
|
|
11046
|
+
var listCommand15 = addApiGatewayOptions3(
|
|
11047
|
+
new import_commander58.Command("list").description("API Gateway stage \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (resourceUpdatedAt\uC740 \uB9AC\uC18C\uC2A4 \uBC18\uC601 \uC2DC\uAC01)").argument("<service-id>", "API Gateway service ID")
|
|
10267
11048
|
).action(async (serviceId, _opts, command) => {
|
|
10268
11049
|
const opts = command.optsWithGlobals();
|
|
10269
11050
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10292,7 +11073,7 @@ var listCommand13 = addApiGatewayOptions3(
|
|
|
10292
11073
|
});
|
|
10293
11074
|
});
|
|
10294
11075
|
var swaggerCommand = addApiGatewayOptions3(
|
|
10295
|
-
new
|
|
11076
|
+
new import_commander58.Command("swagger").description("API Gateway stage Swagger\uB97C \uCD9C\uB825\uD558\uAC70\uB098 \uC800\uC7A5\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--output <file>", "Swagger JSON \uC800\uC7A5 \uACBD\uB85C").option("--force", "\uAE30\uC874 \uD30C\uC77C \uB36E\uC5B4\uC4F0\uAE30")
|
|
10296
11077
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10297
11078
|
const opts = command.optsWithGlobals();
|
|
10298
11079
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10316,7 +11097,7 @@ var swaggerCommand = addApiGatewayOptions3(
|
|
|
10316
11097
|
printJson(swagger);
|
|
10317
11098
|
});
|
|
10318
11099
|
var resourcesCommand = addApiGatewayOptions3(
|
|
10319
|
-
new
|
|
11100
|
+
new import_commander58.Command("resources").description("\uBC30\uD3EC\uB41C API Gateway stage resource \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID")
|
|
10320
11101
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10321
11102
|
const opts = command.optsWithGlobals();
|
|
10322
11103
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10345,8 +11126,8 @@ var resourcesCommand = addApiGatewayOptions3(
|
|
|
10345
11126
|
ids: resources.map((resource) => sanitizeForTerminal(resource.stageResourceId))
|
|
10346
11127
|
});
|
|
10347
11128
|
});
|
|
10348
|
-
var
|
|
10349
|
-
new
|
|
11129
|
+
var updateCommand3 = addApiGatewayOptions3(
|
|
11130
|
+
new import_commander58.Command("update").description("API Gateway stage\uC758 backend endpoint URL\uACFC \uC124\uBA85\uC744 \uC218\uC815\uD55C\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--backend-endpoint-url <url>", "\uBCC0\uACBD\uD560 backend endpoint URL").option("--description <text>", "\uBCC0\uACBD\uD560 stage \uC124\uBA85").option("--yes", "\uC2A4\uD14C\uC774\uC9C0 \uC218\uC815\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
10350
11131
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10351
11132
|
const opts = command.optsWithGlobals();
|
|
10352
11133
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10357,7 +11138,7 @@ var updateCommand2 = addApiGatewayOptions3(
|
|
|
10357
11138
|
EXIT_PARAM_ERROR
|
|
10358
11139
|
);
|
|
10359
11140
|
}
|
|
10360
|
-
|
|
11141
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uC218\uC815");
|
|
10361
11142
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10362
11143
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10363
11144
|
startSpinner(`API Gateway stage "${displayStageId}" \uC218\uC815 \uC911...`);
|
|
@@ -10395,12 +11176,12 @@ var updateCommand2 = addApiGatewayOptions3(
|
|
|
10395
11176
|
process.stderr.write("\uC548\uB0B4: \uC2A4\uD14C\uC774\uC9C0 \uBCC0\uACBD \uD6C4 \uC2E4\uC81C \uD2B8\uB798\uD53D \uBC18\uC601 \uC0C1\uD0DC\uB97C \uD655\uC778\uD558\uC138\uC694.\n");
|
|
10396
11177
|
});
|
|
10397
11178
|
var importResourcesCommand = addApiGatewayOptions3(
|
|
10398
|
-
new
|
|
11179
|
+
new import_commander58.Command("import-resources").description("API Gateway service \uC758 \uB9AC\uC18C\uC2A4\uB97C stage \uB85C \uAC00\uC838\uC628\uB2E4").argument("<service-id>", "API Gateway service ID").argument("<stage-id>", "API Gateway stage ID").option("--yes", "\uC2A4\uD14C\uC774\uC9C0 \uBC18\uC601\uC744 \uD655\uC778\uD55C\uB2E4")
|
|
10399
11180
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10400
11181
|
const opts = command.optsWithGlobals();
|
|
10401
11182
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
10402
11183
|
const parsedStageId = parseRequiredArgument(stageId, "stage-id");
|
|
10403
|
-
|
|
11184
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uBC18\uC601");
|
|
10404
11185
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10405
11186
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10406
11187
|
startSpinner(`API Gateway stage "${displayStageId}" \uB9AC\uC18C\uC2A4 \uBC18\uC601 \uC911...`);
|
|
@@ -10417,16 +11198,16 @@ var importResourcesCommand = addApiGatewayOptions3(
|
|
|
10417
11198
|
"\uC548\uB0B4: \uBC18\uC601\uC740 \uC2A4\uD14C\uC774\uC9C0 \uC124\uC815\uB9CC \uBC14\uAFC9\uB2C8\uB2E4. \uC11C\uBE44\uC2A4\uC5D0 \uC801\uC6A9\uD558\uB824\uBA74 apigateway stage deploy create \uB97C \uC2E4\uD589\uD558\uC138\uC694.\n"
|
|
10418
11199
|
);
|
|
10419
11200
|
});
|
|
10420
|
-
var stageCommand = new
|
|
11201
|
+
var stageCommand = new import_commander58.Command("stage").description("API Gateway stage \uC870\uD68C \uBC0F \uBCC0\uACBD \uBA85\uB839").addCommand(listCommand15).addCommand(swaggerCommand).addCommand(resourcesCommand).addCommand(updateCommand3).addCommand(importResourcesCommand).addCommand(deployCommand);
|
|
10421
11202
|
|
|
10422
11203
|
// src/commands/loadbalancer/list.ts
|
|
10423
|
-
var
|
|
11204
|
+
var import_commander59 = require("commander");
|
|
10424
11205
|
|
|
10425
11206
|
// src/commands/loadbalancer/helpers.ts
|
|
10426
|
-
var
|
|
11207
|
+
var import_node_net2 = require("net");
|
|
10427
11208
|
|
|
10428
11209
|
// src/services/loadbalancer/client.ts
|
|
10429
|
-
var
|
|
11210
|
+
var import_ky16 = __toESM(require("ky"));
|
|
10430
11211
|
|
|
10431
11212
|
// src/services/loadbalancer/types.ts
|
|
10432
11213
|
function isRecord3(value) {
|
|
@@ -10623,7 +11404,7 @@ var LoadBalancerClient = class {
|
|
|
10623
11404
|
async getJson(path5, searchParams) {
|
|
10624
11405
|
const url = `${this.endpoint}${path5}`;
|
|
10625
11406
|
try {
|
|
10626
|
-
return await
|
|
11407
|
+
return await import_ky16.default.get(url, {
|
|
10627
11408
|
headers: this.authHeaders(),
|
|
10628
11409
|
searchParams,
|
|
10629
11410
|
retry: 0,
|
|
@@ -10636,7 +11417,7 @@ var LoadBalancerClient = class {
|
|
|
10636
11417
|
async postJson(path5, json) {
|
|
10637
11418
|
const url = `${this.endpoint}${path5}`;
|
|
10638
11419
|
try {
|
|
10639
|
-
return await
|
|
11420
|
+
return await import_ky16.default.post(url, {
|
|
10640
11421
|
headers: this.authHeaders(),
|
|
10641
11422
|
json,
|
|
10642
11423
|
retry: 0,
|
|
@@ -10649,7 +11430,7 @@ var LoadBalancerClient = class {
|
|
|
10649
11430
|
async putJson(path5, json) {
|
|
10650
11431
|
const url = `${this.endpoint}${path5}`;
|
|
10651
11432
|
try {
|
|
10652
|
-
return await
|
|
11433
|
+
return await import_ky16.default.put(url, {
|
|
10653
11434
|
headers: this.authHeaders(),
|
|
10654
11435
|
json,
|
|
10655
11436
|
retry: 0,
|
|
@@ -10662,7 +11443,7 @@ var LoadBalancerClient = class {
|
|
|
10662
11443
|
async deleteNoContent(path5) {
|
|
10663
11444
|
const url = `${this.endpoint}${path5}`;
|
|
10664
11445
|
try {
|
|
10665
|
-
await
|
|
11446
|
+
await import_ky16.default.delete(url, {
|
|
10666
11447
|
headers: this.authHeaders(),
|
|
10667
11448
|
retry: 0,
|
|
10668
11449
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -10674,26 +11455,10 @@ var LoadBalancerClient = class {
|
|
|
10674
11455
|
};
|
|
10675
11456
|
|
|
10676
11457
|
// src/commands/loadbalancer/helpers.ts
|
|
10677
|
-
function requireResourceInput(value, label) {
|
|
10678
|
-
const normalized = value.trim();
|
|
10679
|
-
if (!normalized) {
|
|
10680
|
-
throw new NhnCloudCliError(`${label} \uC774\uB984 \uB610\uB294 UUID\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
10681
|
-
}
|
|
10682
|
-
return normalized;
|
|
10683
|
-
}
|
|
10684
11458
|
function optionalTrimmed(value) {
|
|
10685
11459
|
if (value === void 0) return void 0;
|
|
10686
11460
|
return value.trim();
|
|
10687
11461
|
}
|
|
10688
|
-
function requireYes2(yes, operation) {
|
|
10689
|
-
if (!yes) {
|
|
10690
|
-
throw new NhnCloudCliError(
|
|
10691
|
-
`${operation}\uC5D0\uB294 --yes \uD50C\uB798\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`,
|
|
10692
|
-
EXIT_PARAM_ERROR
|
|
10693
|
-
);
|
|
10694
|
-
}
|
|
10695
|
-
return true;
|
|
10696
|
-
}
|
|
10697
11462
|
function parseIpAclAction(value) {
|
|
10698
11463
|
if (value !== "ALLOW" && value !== "DENY") {
|
|
10699
11464
|
throw new NhnCloudCliError(
|
|
@@ -10716,7 +11481,7 @@ function parseIpOrCidr(value) {
|
|
|
10716
11481
|
const normalized = value.trim();
|
|
10717
11482
|
const parts = normalized.split("/");
|
|
10718
11483
|
const address = parts[0] ?? "";
|
|
10719
|
-
const version = (0,
|
|
11484
|
+
const version = (0, import_node_net2.isIP)(address);
|
|
10720
11485
|
if (version === 0 || parts.length > 2) {
|
|
10721
11486
|
throw new NhnCloudCliError(
|
|
10722
11487
|
`--cidr\uC740 IP \uC8FC\uC18C \uB610\uB294 CIDR\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(value)}`,
|
|
@@ -10735,30 +11500,6 @@ function parseIpOrCidr(value) {
|
|
|
10735
11500
|
}
|
|
10736
11501
|
return normalized;
|
|
10737
11502
|
}
|
|
10738
|
-
function resolvedId(resource, label) {
|
|
10739
|
-
const id = resource.id.trim();
|
|
10740
|
-
if (!id) {
|
|
10741
|
-
throw new NhnCloudCliError(`${label} \uC870\uD68C \uACB0\uACFC\uC758 UUID\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
10742
|
-
}
|
|
10743
|
-
return id;
|
|
10744
|
-
}
|
|
10745
|
-
function resolveFromList(resources, input, label) {
|
|
10746
|
-
const exactId = resources.find((resource) => resource.id === input);
|
|
10747
|
-
if (exactId) return resolvedId(exactId, label);
|
|
10748
|
-
const nameMatches = resources.filter((resource) => resource.name === input);
|
|
10749
|
-
if (nameMatches.length === 1) return resolvedId(nameMatches[0], label);
|
|
10750
|
-
if (nameMatches.length === 0) {
|
|
10751
|
-
throw new NhnCloudCliError(
|
|
10752
|
-
`${label}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${JSON.stringify(input)}`,
|
|
10753
|
-
EXIT_PARAM_ERROR
|
|
10754
|
-
);
|
|
10755
|
-
}
|
|
10756
|
-
const candidateIds = nameMatches.map((resource) => resolvedId(resource, label)).sort();
|
|
10757
|
-
throw new NhnCloudCliError(
|
|
10758
|
-
`${label} \uC774\uB984\uC774 \uC911\uBCF5\uB429\uB2C8\uB2E4: ${JSON.stringify(input)} (\uD6C4\uBCF4 UUID: ${candidateIds.join(", ")})`,
|
|
10759
|
-
EXIT_PARAM_ERROR
|
|
10760
|
-
);
|
|
10761
|
-
}
|
|
10762
11503
|
async function resolveLoadBalancerId(client, value) {
|
|
10763
11504
|
const input = requireResourceInput(value, "Load Balancer");
|
|
10764
11505
|
const resources = await client.listLoadBalancers();
|
|
@@ -10793,7 +11534,7 @@ async function resolveLoadBalancerClient(opts) {
|
|
|
10793
11534
|
}
|
|
10794
11535
|
|
|
10795
11536
|
// src/commands/loadbalancer/list.ts
|
|
10796
|
-
var
|
|
11537
|
+
var listCommand16 = new import_commander59.Command("list").description("Load Balancer \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
10797
11538
|
const opts = cmd.optsWithGlobals();
|
|
10798
11539
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
10799
11540
|
startSpinner("Load Balancer \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -10831,8 +11572,8 @@ var listCommand14 = new import_commander55.Command("list").description("Load Bal
|
|
|
10831
11572
|
});
|
|
10832
11573
|
|
|
10833
11574
|
// src/commands/loadbalancer/get.ts
|
|
10834
|
-
var
|
|
10835
|
-
var
|
|
11575
|
+
var import_commander60 = require("commander");
|
|
11576
|
+
var getCommand11 = new import_commander60.Command("get").description("Load Balancer\uB97C \uC774\uB984 \uB610\uB294 UUID\uB85C \uC870\uD68C\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (loadBalancerInput, _opts, cmd) => {
|
|
10836
11577
|
const opts = cmd.optsWithGlobals();
|
|
10837
11578
|
const input = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
10838
11579
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10869,10 +11610,10 @@ var getCommand9 = new import_commander56.Command("get").description("Load Balanc
|
|
|
10869
11610
|
});
|
|
10870
11611
|
|
|
10871
11612
|
// src/commands/loadbalancer/ipacl.ts
|
|
10872
|
-
var
|
|
11613
|
+
var import_commander62 = require("commander");
|
|
10873
11614
|
|
|
10874
11615
|
// src/commands/loadbalancer/target.ts
|
|
10875
|
-
var
|
|
11616
|
+
var import_commander61 = require("commander");
|
|
10876
11617
|
|
|
10877
11618
|
// src/commands/loadbalancer/rebind.ts
|
|
10878
11619
|
function shellQuote(value) {
|
|
@@ -11003,7 +11744,7 @@ function targetWriteResult(operation, target, rebind) {
|
|
|
11003
11744
|
rebind
|
|
11004
11745
|
};
|
|
11005
11746
|
}
|
|
11006
|
-
var
|
|
11747
|
+
var listCommand17 = new import_commander61.Command("list").description("IP ACL \uB300\uC0C1 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (groupInput, _opts, cmd) => {
|
|
11007
11748
|
const opts = cmd.optsWithGlobals();
|
|
11008
11749
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11009
11750
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -11032,9 +11773,9 @@ var listCommand15 = new import_commander57.Command("list").description("IP ACL \
|
|
|
11032
11773
|
ids: targets.map((target) => target.id)
|
|
11033
11774
|
});
|
|
11034
11775
|
});
|
|
11035
|
-
var addCommand = new
|
|
11776
|
+
var addCommand = new import_commander61.Command("add").description("IP ACL \uB300\uC0C1\uC744 \uCD94\uAC00\uD558\uACE0 \uC5F0\uACB0\uB41C Load Balancer\uB97C \uC7AC\uBC14\uC778\uB529\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").requiredOption("--cidr <ip-or-cidr>", "\uCD94\uAC00\uD560 IP \uC8FC\uC18C \uB610\uB294 CIDR").option("--description <text>", "IP ACL \uB300\uC0C1 \uC124\uBA85").option("--no-rebind", "\uB300\uC0C1 \uCD94\uAC00 \uD6C4 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC0DD\uB7B5").option("--yes", "\uB300\uC0C1 \uCD94\uAC00 \uD655\uC778").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (groupInput, _opts, cmd) => {
|
|
11036
11777
|
const opts = cmd.optsWithGlobals();
|
|
11037
|
-
|
|
11778
|
+
requireYes(opts.yes, "IP ACL \uB300\uC0C1 \uCD94\uAC00");
|
|
11038
11779
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11039
11780
|
const parsedCidr = parseIpOrCidr(opts.cidr ?? "");
|
|
11040
11781
|
const parsedDescription = optionalTrimmed(opts.description);
|
|
@@ -11069,9 +11810,9 @@ var addCommand = new import_commander57.Command("add").description("IP ACL \uB30
|
|
|
11069
11810
|
writeTargetWarnings(group, result);
|
|
11070
11811
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
11071
11812
|
});
|
|
11072
|
-
var removeCommand = new
|
|
11813
|
+
var removeCommand = new import_commander61.Command("remove").description("IP ACL \uB300\uC0C1\uC744 \uC0AD\uC81C\uD558\uACE0 \uC5F0\uACB0\uB41C Load Balancer\uB97C \uC7AC\uBC14\uC778\uB529\uD55C\uB2E4").argument("<target-id>", "\uC0AD\uC81C\uD560 IP ACL \uB300\uC0C1 UUID").option("--no-rebind", "\uB300\uC0C1 \uC0AD\uC81C \uD6C4 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC0DD\uB7B5").option("--yes", "\uB300\uC0C1 \uC0AD\uC81C \uD655\uC778").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (targetInput, _opts, cmd) => {
|
|
11073
11814
|
const opts = cmd.optsWithGlobals();
|
|
11074
|
-
|
|
11815
|
+
requireYes(opts.yes, "IP ACL \uB300\uC0C1 \uC0AD\uC81C");
|
|
11075
11816
|
const parsedTargetId = requireResourceInput(targetInput, "IP ACL \uB300\uC0C1");
|
|
11076
11817
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
11077
11818
|
startSpinner("IP ACL \uB300\uC0C1 \uC0AD\uC81C\uC640 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC911...");
|
|
@@ -11100,13 +11841,13 @@ var removeCommand = new import_commander57.Command("remove").description("IP ACL
|
|
|
11100
11841
|
writeTargetWarnings(group, result);
|
|
11101
11842
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
11102
11843
|
});
|
|
11103
|
-
var targetCommand = new
|
|
11104
|
-
targetCommand.addCommand(
|
|
11844
|
+
var targetCommand = new import_commander61.Command("target").description("IP ACL \uB300\uC0C1 \uC870\uD68C\xB7\uAD00\uB9AC");
|
|
11845
|
+
targetCommand.addCommand(listCommand17);
|
|
11105
11846
|
targetCommand.addCommand(addCommand);
|
|
11106
11847
|
targetCommand.addCommand(removeCommand);
|
|
11107
11848
|
|
|
11108
11849
|
// src/commands/loadbalancer/ipacl.ts
|
|
11109
|
-
var
|
|
11850
|
+
var listCommand18 = new import_commander62.Command("list").description("IP ACL \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
11110
11851
|
const opts = cmd.optsWithGlobals();
|
|
11111
11852
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
11112
11853
|
startSpinner("IP ACL \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -11134,7 +11875,7 @@ var listCommand16 = new import_commander58.Command("list").description("IP ACL \
|
|
|
11134
11875
|
ids: groups.map((group) => group.id)
|
|
11135
11876
|
});
|
|
11136
11877
|
});
|
|
11137
|
-
var
|
|
11878
|
+
var getCommand12 = new import_commander62.Command("get").description("IP ACL \uADF8\uB8F9\uC744 \uC774\uB984 \uB610\uB294 UUID\uB85C \uC870\uD68C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (groupInput, _opts, cmd) => {
|
|
11138
11879
|
const opts = cmd.optsWithGlobals();
|
|
11139
11880
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11140
11881
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -11167,7 +11908,7 @@ var getCommand10 = new import_commander58.Command("get").description("IP ACL \uA
|
|
|
11167
11908
|
ids: [group.id]
|
|
11168
11909
|
});
|
|
11169
11910
|
});
|
|
11170
|
-
var
|
|
11911
|
+
var createCommand11 = new import_commander62.Command("create").description("IP ACL \uADF8\uB8F9\uC744 \uC0DD\uC131\uD55C\uB2E4").requiredOption("--name <name>", "IP ACL \uADF8\uB8F9 \uC774\uB984").requiredOption("--action <ALLOW|DENY>", "IP \uC811\uADFC \uC81C\uC5B4 \uB3D9\uC791").option("--description <text>", "IP ACL \uADF8\uB8F9 \uC124\uBA85").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
11171
11912
|
const opts = cmd.optsWithGlobals();
|
|
11172
11913
|
const parsedName = requireResourceInput(opts.name ?? "", "IP ACL \uADF8\uB8F9");
|
|
11173
11914
|
const parsedAction = parseIpAclAction(opts.action ?? "");
|
|
@@ -11198,9 +11939,9 @@ var createCommand9 = new import_commander58.Command("create").description("IP AC
|
|
|
11198
11939
|
ids: [group.id]
|
|
11199
11940
|
});
|
|
11200
11941
|
});
|
|
11201
|
-
var
|
|
11942
|
+
var deleteCommand9 = new import_commander62.Command("delete").description("IP ACL \uADF8\uB8F9\uACFC \uD558\uC704 \uB300\uC0C1\uC744 \uC0AD\uC81C\uD55C\uB2E4").argument("<group>", "IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID").option("--yes", "\uC0AD\uC81C\uC640 \uC5F0\uACB0 \uADDC\uCE59 \uC81C\uAC70 \uD655\uC778").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (groupInput, _opts, cmd) => {
|
|
11202
11943
|
const opts = cmd.optsWithGlobals();
|
|
11203
|
-
const confirmedYes =
|
|
11944
|
+
const confirmedYes = requireYes(opts.yes, "IP ACL \uADF8\uB8F9 \uC0AD\uC81C");
|
|
11204
11945
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11205
11946
|
if (confirmedYes) {
|
|
11206
11947
|
process.stderr.write(
|
|
@@ -11230,11 +11971,11 @@ var deleteCommand7 = new import_commander58.Command("delete").description("IP AC
|
|
|
11230
11971
|
ids: [groupId]
|
|
11231
11972
|
});
|
|
11232
11973
|
});
|
|
11233
|
-
var ipaclCommand = new
|
|
11234
|
-
ipaclCommand.addCommand(
|
|
11235
|
-
ipaclCommand.addCommand(
|
|
11236
|
-
ipaclCommand.addCommand(
|
|
11237
|
-
ipaclCommand.addCommand(
|
|
11974
|
+
var ipaclCommand = new import_commander62.Command("ipacl").description("IP ACL \uADF8\uB8F9\xB7\uB300\uC0C1 \uC870\uD68C");
|
|
11975
|
+
ipaclCommand.addCommand(listCommand18);
|
|
11976
|
+
ipaclCommand.addCommand(getCommand12);
|
|
11977
|
+
ipaclCommand.addCommand(createCommand11);
|
|
11978
|
+
ipaclCommand.addCommand(deleteCommand9);
|
|
11238
11979
|
ipaclCommand.addCommand(targetCommand);
|
|
11239
11980
|
|
|
11240
11981
|
// src/commands/loadbalancer/help.ts
|
|
@@ -11246,7 +11987,7 @@ function configureLoadBalancerHelp(command) {
|
|
|
11246
11987
|
}
|
|
11247
11988
|
|
|
11248
11989
|
// src/commands/loadbalancer/binding.ts
|
|
11249
|
-
var
|
|
11990
|
+
var import_commander63 = require("commander");
|
|
11250
11991
|
function bindingResult(operation, loadBalancerId, groupIds) {
|
|
11251
11992
|
return {
|
|
11252
11993
|
operation,
|
|
@@ -11268,13 +12009,13 @@ function outputBindingResult(opts, result) {
|
|
|
11268
12009
|
ids: [result.loadbalancer_id]
|
|
11269
12010
|
});
|
|
11270
12011
|
}
|
|
11271
|
-
var setIpAclCommand2 = new
|
|
12012
|
+
var setIpAclCommand2 = new import_commander63.Command("set-ipacl").description("Load Balancer\uC758 IP ACL \uADF8\uB8F9 \uC5F0\uACB0\uC744 \uC804\uCCB4 \uAD50\uCCB4\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").requiredOption(
|
|
11272
12013
|
"--group <group>",
|
|
11273
12014
|
"\uC801\uC6A9\uD560 IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
11274
12015
|
collectOption
|
|
11275
12016
|
).option("--yes", "\uAE30\uC874 \uC5F0\uACB0 \uC804\uCCB4 \uAD50\uCCB4 \uD655\uC778").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (loadBalancerInput, _opts, cmd) => {
|
|
11276
12017
|
const opts = cmd.optsWithGlobals();
|
|
11277
|
-
const confirmedYes =
|
|
12018
|
+
const confirmedYes = requireYes(opts.yes, "Load Balancer IP ACL \uC5F0\uACB0 \uAD50\uCCB4");
|
|
11278
12019
|
const parsedLoadBalancer = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
11279
12020
|
const parsedGroups = requireResourceInputs(opts.group ?? [], "IP ACL \uADF8\uB8F9");
|
|
11280
12021
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -11308,9 +12049,9 @@ var setIpAclCommand2 = new import_commander59.Command("set-ipacl").description("
|
|
|
11308
12049
|
bindingResult("loadbalancer-set-ipacl", loadBalancerId, groupIds)
|
|
11309
12050
|
);
|
|
11310
12051
|
});
|
|
11311
|
-
var clearIpAclCommand = new
|
|
12052
|
+
var clearIpAclCommand = new import_commander63.Command("clear-ipacl").description("Load Balancer\uC758 \uBAA8\uB4E0 IP ACL \uADF8\uB8F9 \uC5F0\uACB0\uC744 \uD574\uC81C\uD55C\uB2E4").argument("<loadbalancer>", "Load Balancer \uC774\uB984 \uB610\uB294 UUID").option("--yes", "\uBAA8\uB4E0 IP ACL \uC5F0\uACB0 \uD574\uC81C \uD655\uC778").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (loadBalancerInput, _opts, cmd) => {
|
|
11312
12053
|
const opts = cmd.optsWithGlobals();
|
|
11313
|
-
const confirmedYes =
|
|
12054
|
+
const confirmedYes = requireYes(opts.yes, "Load Balancer IP ACL \uC5F0\uACB0 \uD574\uC81C");
|
|
11314
12055
|
const parsedLoadBalancer = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
11315
12056
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
11316
12057
|
startSpinner("Load Balancer IP ACL \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -11360,6 +12101,8 @@ var networkAgentWorkflow = `
|
|
|
11360
12101
|
Agent workflow:
|
|
11361
12102
|
1. nhncloud network list --json
|
|
11362
12103
|
2. nhncloud network subnet list --json
|
|
12104
|
+
3. nhncloud network security-group list --json
|
|
12105
|
+
4. nhncloud network security-group ports <group> --json
|
|
11363
12106
|
`;
|
|
11364
12107
|
var volumeAgentWorkflow = `
|
|
11365
12108
|
Agent workflow:
|
|
@@ -11397,8 +12140,8 @@ Agent workflow:
|
|
|
11397
12140
|
2. nhncloud ncs workload list --json
|
|
11398
12141
|
3. nhncloud ncs workload get <id> --json
|
|
11399
12142
|
`;
|
|
11400
|
-
var program = new
|
|
11401
|
-
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.
|
|
12143
|
+
var program = new import_commander64.Command();
|
|
12144
|
+
program.name("nhncloud").description("NHN Cloud CLI \u2014 AI agent & terminal friendly").version("0.18.0").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "\uCD5C\uC18C \uCD9C\uB825 (\uC790\uB3D9\uD654\uC6A9)").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654").option("--request-timeout <sec>", "HTTP \uC694\uCCAD \uD0C0\uC784\uC544\uC6C3 (\uCD08, \uAE30\uBCF8 30, \uBC94\uC704 1~3600). NHNCLOUD_REQUEST_TIMEOUT \uB85C\uB3C4 \uC9C0\uC815").addHelpText("after", rootAgentHints);
|
|
11402
12145
|
program.hook("preAction", () => {
|
|
11403
12146
|
const opts = program.opts();
|
|
11404
12147
|
const rawTimeout = opts.requestTimeout ?? process.env["NHNCLOUD_REQUEST_TIMEOUT"];
|
|
@@ -11419,13 +12162,13 @@ program.hook("preAction", () => {
|
|
|
11419
12162
|
}
|
|
11420
12163
|
});
|
|
11421
12164
|
program.addCommand(configureCommand);
|
|
11422
|
-
var logncrashCommand = new
|
|
12165
|
+
var logncrashCommand = new import_commander64.Command("logncrash").description("Log & Crash \uAD00\uB828 \uBA85\uB839").addHelpText("after", logncrashAgentWorkflow);
|
|
11423
12166
|
logncrashCommand.addCommand(availableTokenCommand);
|
|
11424
12167
|
logncrashCommand.addCommand(searchCommand);
|
|
11425
12168
|
logncrashCommand.addCommand(sendCommand);
|
|
11426
12169
|
logncrashCommand.addCommand(exportCommand);
|
|
11427
12170
|
program.addCommand(logncrashCommand);
|
|
11428
|
-
var deployCommand2 = new
|
|
12171
|
+
var deployCommand2 = new import_commander64.Command("deploy").description("NHN Cloud Deploy \uAD00\uB828 \uBA85\uB839").addHelpText("after", deployAgentWorkflow);
|
|
11429
12172
|
deployCommand2.hook("preSubcommand", async () => {
|
|
11430
12173
|
await warnLegacyDeployTargets();
|
|
11431
12174
|
});
|
|
@@ -11439,13 +12182,13 @@ deployCommand2.addCommand(binariesCommand);
|
|
|
11439
12182
|
deployCommand2.addCommand(uploadCommand);
|
|
11440
12183
|
deployCommand2.addCommand(downloadCommand);
|
|
11441
12184
|
program.addCommand(deployCommand2);
|
|
11442
|
-
var instanceCommand = new
|
|
12185
|
+
var instanceCommand = new import_commander64.Command("instance").description("Compute \uC778\uC2A4\uD134\uC2A4 \uAD00\uB828 \uBA85\uB839").addHelpText("after", instanceAgentWorkflow);
|
|
11443
12186
|
instanceCommand.addCommand(listCommand);
|
|
11444
12187
|
instanceCommand.addCommand(flavorsCommand);
|
|
11445
12188
|
instanceCommand.addCommand(availabilityZonesCommand);
|
|
11446
|
-
instanceCommand.addCommand(
|
|
11447
|
-
instanceCommand.addCommand(
|
|
11448
|
-
instanceCommand.addCommand(
|
|
12189
|
+
instanceCommand.addCommand(getCommand4);
|
|
12190
|
+
instanceCommand.addCommand(createCommand5);
|
|
12191
|
+
instanceCommand.addCommand(deleteCommand4);
|
|
11449
12192
|
instanceCommand.addCommand(startCommand);
|
|
11450
12193
|
instanceCommand.addCommand(stopCommand);
|
|
11451
12194
|
instanceCommand.addCommand(rebootCommand);
|
|
@@ -11457,50 +12200,52 @@ instanceCommand.addCommand(keypairsCommand);
|
|
|
11457
12200
|
instanceCommand.addCommand(keypairCommand);
|
|
11458
12201
|
instanceCommand.addCommand(volumeCommand);
|
|
11459
12202
|
instanceCommand.addCommand(volumesCommand);
|
|
12203
|
+
instanceCommand.addCommand(securityGroupCommand2);
|
|
11460
12204
|
program.addCommand(instanceCommand);
|
|
11461
|
-
var networkCommand = new
|
|
12205
|
+
var networkCommand = new import_commander64.Command("network").description("VPC\xB7\uC11C\uBE0C\uB137 \uC870\uD68C\uC640 \uBCF4\uC548\uADF8\uB8F9 \uAD00\uB9AC").addHelpText("after", networkAgentWorkflow);
|
|
11462
12206
|
networkCommand.addCommand(listCommand3);
|
|
11463
12207
|
networkCommand.addCommand(subnetCommand);
|
|
12208
|
+
networkCommand.addCommand(securityGroupCommand);
|
|
11464
12209
|
program.addCommand(networkCommand);
|
|
11465
|
-
var volumeCommand2 = new
|
|
12210
|
+
var volumeCommand2 = new import_commander64.Command("volume").description("Block Storage \uBCFC\uB968 \uAD00\uB828 \uBA85\uB839").addHelpText("after", volumeAgentWorkflow);
|
|
11466
12211
|
volumeCommand2.addCommand(listCommand2);
|
|
11467
12212
|
volumeCommand2.addCommand(getCommand);
|
|
11468
12213
|
volumeCommand2.addCommand(createCommand);
|
|
11469
12214
|
program.addCommand(volumeCommand2);
|
|
11470
|
-
var floatingipCommand = new
|
|
12215
|
+
var floatingipCommand = new import_commander64.Command("floatingip").description(
|
|
11471
12216
|
"Floating IP(\uC778\uC2A4\uD134\uC2A4 \uACF5\uC778 IP) \uAD00\uB9AC"
|
|
11472
12217
|
).addHelpText("after", floatingIpAgentWorkflow);
|
|
11473
|
-
floatingipCommand.addCommand(
|
|
11474
|
-
floatingipCommand.addCommand(
|
|
11475
|
-
floatingipCommand.addCommand(
|
|
12218
|
+
floatingipCommand.addCommand(listCommand6);
|
|
12219
|
+
floatingipCommand.addCommand(createCommand4);
|
|
12220
|
+
floatingipCommand.addCommand(deleteCommand3);
|
|
11476
12221
|
program.addCommand(floatingipCommand);
|
|
11477
|
-
var loadbalancerCommand = new
|
|
11478
|
-
loadbalancerCommand.addCommand(
|
|
11479
|
-
loadbalancerCommand.addCommand(
|
|
12222
|
+
var loadbalancerCommand = new import_commander64.Command("loadbalancer").description("Load Balancer\xB7IP ACL \uC870\uD68C\xB7\uAD00\uB9AC").addHelpText("after", loadbalancerAgentWorkflow);
|
|
12223
|
+
loadbalancerCommand.addCommand(listCommand16);
|
|
12224
|
+
loadbalancerCommand.addCommand(getCommand11);
|
|
11480
12225
|
loadbalancerCommand.addCommand(ipaclCommand);
|
|
11481
12226
|
loadbalancerCommand.addCommand(setIpAclCommand2);
|
|
11482
12227
|
loadbalancerCommand.addCommand(clearIpAclCommand);
|
|
11483
12228
|
configureLoadBalancerHelp(loadbalancerCommand);
|
|
11484
12229
|
program.addCommand(loadbalancerCommand);
|
|
11485
|
-
var ncrCommand = new
|
|
11486
|
-
ncrCommand.addCommand(
|
|
11487
|
-
ncrCommand.addCommand(
|
|
12230
|
+
var ncrCommand = new import_commander64.Command("ncr").description("NHN Container Registry \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncrAgentWorkflow);
|
|
12231
|
+
ncrCommand.addCommand(listCommand7);
|
|
12232
|
+
ncrCommand.addCommand(getCommand5);
|
|
11488
12233
|
ncrCommand.addCommand(imagesCommand2);
|
|
11489
12234
|
ncrCommand.addCommand(tagsCommand);
|
|
11490
12235
|
program.addCommand(ncrCommand);
|
|
11491
|
-
var nksCommand = new
|
|
12236
|
+
var nksCommand = new import_commander64.Command("nks").description("NHN Kubernetes Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", nksAgentWorkflow);
|
|
11492
12237
|
nksCommand.addCommand(supportsCommand);
|
|
11493
12238
|
nksCommand.addCommand(clusterCommand);
|
|
11494
12239
|
nksCommand.addCommand(nodegroupCommand);
|
|
11495
12240
|
nksCommand.addCommand(addonTypeCommand);
|
|
11496
12241
|
nksCommand.addCommand(addonCommand);
|
|
11497
12242
|
program.addCommand(nksCommand);
|
|
11498
|
-
var ncsCommand = new
|
|
12243
|
+
var ncsCommand = new import_commander64.Command("ncs").description("NHN Container Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncsAgentWorkflow);
|
|
11499
12244
|
ncsCommand.addCommand(templateCommand);
|
|
11500
12245
|
ncsCommand.addCommand(workloadCommand);
|
|
11501
12246
|
ncsCommand.addCommand(malwareCommand);
|
|
11502
12247
|
program.addCommand(ncsCommand);
|
|
11503
|
-
var apiGatewayCommand = new
|
|
12248
|
+
var apiGatewayCommand = new import_commander64.Command("apigateway").description("NHN API Gateway \uC870\uD68C \uBA85\uB839");
|
|
11504
12249
|
apiGatewayCommand.addCommand(serviceCommand);
|
|
11505
12250
|
apiGatewayCommand.addCommand(resourceCommand);
|
|
11506
12251
|
apiGatewayCommand.addCommand(stageCommand);
|
|
@@ -11510,7 +12255,7 @@ program.addCommand(doctorCommand);
|
|
|
11510
12255
|
program.addCommand(createCommandsCommand(program));
|
|
11511
12256
|
configureCommanderExitCodes(program);
|
|
11512
12257
|
program.parseAsync().catch((err) => {
|
|
11513
|
-
if (err instanceof
|
|
12258
|
+
if (err instanceof import_commander64.CommanderError) {
|
|
11514
12259
|
process.exit(err.exitCode);
|
|
11515
12260
|
}
|
|
11516
12261
|
const message = sanitizeMultilineForTerminal(
|