@bifos/nhncloud-cli 0.16.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 +25 -0
- package/dist/index.js +1229 -381
- 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 +19 -84
- package/skills/nhncloud-cli/references/deploy.md +5 -37
- package/skills/nhncloud-cli/references/iaas.md +58 -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 +1 -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
|
|
@@ -192,6 +192,24 @@ nhncloud configure \uB97C \uC2E4\uD589\uD574 UAK id/secret \uC744 \uC124\uC815\u
|
|
|
192
192
|
}
|
|
193
193
|
return uak;
|
|
194
194
|
}
|
|
195
|
+
async function getProfileEnvironment(profileName, allowMissing = false) {
|
|
196
|
+
const credentials = allowMissing ? await loadCredentialsOrEmpty() : await loadCredentials();
|
|
197
|
+
const profile = credentials.profiles[profileName];
|
|
198
|
+
if (!profile) {
|
|
199
|
+
if (allowMissing) return "real";
|
|
200
|
+
throw new NhnCloudCliError(`profile "${profileName}" \uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`, EXIT_CONFIG_ERROR);
|
|
201
|
+
}
|
|
202
|
+
const environment = profile.environment;
|
|
203
|
+
if (environment !== void 0 && environment !== "gov") {
|
|
204
|
+
throw new NhnCloudCliError(`profile "${profileName}" \uC758 environment \uB294 gov \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. \uC77C\uBC18\uB9DD\uC740 \uC774 \uD544\uB4DC\uB97C \uC0DD\uB7B5\uD558\uC138\uC694.`, EXIT_CONFIG_ERROR);
|
|
205
|
+
}
|
|
206
|
+
return environment ?? "real";
|
|
207
|
+
}
|
|
208
|
+
async function requireRealEnvironment(profileName, service) {
|
|
209
|
+
if (await getProfileEnvironment(profileName) === "gov") {
|
|
210
|
+
throw new NhnCloudCliError(`${service}\uC758 \uACF5\uACF5\uB9DD API endpoint\uB294 \uC544\uC9C1 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.`, EXIT_CONFIG_ERROR);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
195
213
|
async function getServiceCredential(service, profileName) {
|
|
196
214
|
const cred = await getOptionalServiceCredential(service, profileName);
|
|
197
215
|
if (!cred) {
|
|
@@ -205,7 +223,7 @@ ${CREDENTIALS_PATH} \uC5D0\uC11C profiles.${profileName}.${service} \uBE14\uB85D
|
|
|
205
223
|
return cred;
|
|
206
224
|
}
|
|
207
225
|
async function getOptionalServiceCredential(service, profileName) {
|
|
208
|
-
if (service === "userAccessKey" || service === "iaas") {
|
|
226
|
+
if (service === "userAccessKey" || service === "iaas" || service === "environment") {
|
|
209
227
|
throw new NhnCloudCliError(
|
|
210
228
|
`"${service}" \uB294 \uC11C\uBE44\uC2A4 \uC790\uACA9\uC99D\uBA85\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uC804\uC6A9 getter \uB97C \uC0AC\uC6A9\uD558\uC138\uC694.`,
|
|
211
229
|
EXIT_PARAM_ERROR
|
|
@@ -525,14 +543,17 @@ function toNhnCloudCliError(err) {
|
|
|
525
543
|
}
|
|
526
544
|
|
|
527
545
|
// src/api/oauth.ts
|
|
528
|
-
var OAUTH_ENDPOINT =
|
|
546
|
+
var OAUTH_ENDPOINT = {
|
|
547
|
+
real: "https://oauth.api.nhncloudservice.com/oauth2/token/create",
|
|
548
|
+
gov: "https://oauth.api.gov-nhncloudservice.com/oauth2/token/create"
|
|
549
|
+
};
|
|
529
550
|
function isTokenResponse(val) {
|
|
530
551
|
if (typeof val !== "object" || val === null) return false;
|
|
531
552
|
const obj = val;
|
|
532
553
|
return typeof obj["access_token"] === "string" && typeof obj["expires_in"] === "number";
|
|
533
554
|
}
|
|
534
|
-
async function getAccessToken(profile, uakId, uakSecret, forceRefresh = false) {
|
|
535
|
-
const credentialHash = credentialFingerprint(JSON.stringify([uakId, uakSecret]));
|
|
555
|
+
async function getAccessToken(profile, uakId, uakSecret, forceRefresh = false, environment = "real") {
|
|
556
|
+
const credentialHash = credentialFingerprint(JSON.stringify([environment, uakId, uakSecret]));
|
|
536
557
|
if (!forceRefresh) {
|
|
537
558
|
const cached = await readToken(profile, credentialHash);
|
|
538
559
|
if (cached !== null) {
|
|
@@ -542,7 +563,7 @@ async function getAccessToken(profile, uakId, uakSecret, forceRefresh = false) {
|
|
|
542
563
|
const basicCredential = Buffer.from(`${uakId}:${uakSecret}`).toString("base64");
|
|
543
564
|
let raw;
|
|
544
565
|
try {
|
|
545
|
-
raw = await import_ky2.default.post(OAUTH_ENDPOINT, {
|
|
566
|
+
raw = await import_ky2.default.post(OAUTH_ENDPOINT[environment], {
|
|
546
567
|
headers: {
|
|
547
568
|
Authorization: `Basic ${basicCredential}`,
|
|
548
569
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -573,18 +594,29 @@ var ENDPOINTS = {
|
|
|
573
594
|
"logncrash-collector": "https://api-logncrash.nhncloudservice.com",
|
|
574
595
|
deploy: "https://api-deploy.nhncloudservice.com"
|
|
575
596
|
};
|
|
576
|
-
|
|
577
|
-
|
|
597
|
+
var GOV_ENDPOINTS = {
|
|
598
|
+
deploy: "https://api-tcd.gov-nhncloudservice.com"
|
|
599
|
+
};
|
|
600
|
+
function endpointFor(service, environment = "real") {
|
|
601
|
+
const endpoints = environment === "gov" ? GOV_ENDPOINTS : ENDPOINTS;
|
|
602
|
+
const endpoint = endpoints[service];
|
|
578
603
|
if (!endpoint) {
|
|
579
604
|
throw new NhnCloudCliError(
|
|
580
|
-
`\uB4F1\uB85D\uB418\uC9C0 \uC54A\uC740 \uC11C\uBE44\uC2A4\uC785\uB2C8\uB2E4: "${service}". \uC9C0\uC6D0 \uC11C\uBE44\uC2A4: ${Object.keys(
|
|
605
|
+
`\uB4F1\uB85D\uB418\uC9C0 \uC54A\uC740 \uC11C\uBE44\uC2A4\uC785\uB2C8\uB2E4: "${service}". \uC9C0\uC6D0 \uC11C\uBE44\uC2A4: ${Object.keys(endpoints).join(", ")}`,
|
|
581
606
|
EXIT_API_ERROR
|
|
582
607
|
);
|
|
583
608
|
}
|
|
584
609
|
return endpoint;
|
|
585
610
|
}
|
|
586
|
-
function keystoneIdentityUrl() {
|
|
587
|
-
return
|
|
611
|
+
function keystoneIdentityUrl(environment = "real") {
|
|
612
|
+
return `https://api-identity-infrastructure.${environment === "gov" ? "gov-" : ""}nhncloudservice.com/v2.0/tokens`;
|
|
613
|
+
}
|
|
614
|
+
var GOV_IAAS_REGIONS = ["kr1", "kr2"];
|
|
615
|
+
function govIaasHost(region, service) {
|
|
616
|
+
if (!GOV_IAAS_REGIONS.includes(region)) {
|
|
617
|
+
throw new NhnCloudCliError(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uACF5\uACF5\uB9DD IaaS region \uC785\uB2C8\uB2E4: "${region}". \uC0AC\uC6A9 \uAC00\uB2A5\uD55C region: ${GOV_IAAS_REGIONS.join(", ")}`, EXIT_PARAM_ERROR);
|
|
618
|
+
}
|
|
619
|
+
return `${region}-api-${service}-infrastructure.gov-nhncloudservice.com`;
|
|
588
620
|
}
|
|
589
621
|
var INSTANCE_HOST = {
|
|
590
622
|
kr1: "kr1-api-instance-infrastructure.nhncloudservice.com",
|
|
@@ -621,7 +653,11 @@ var NCR_HOST = {
|
|
|
621
653
|
kr2: "kr2-ncr.api.nhncloudservice.com",
|
|
622
654
|
kr3: "kr3-ncr.api.nhncloudservice.com"
|
|
623
655
|
};
|
|
624
|
-
function ncrHost(region) {
|
|
656
|
+
function ncrHost(region, environment = "real") {
|
|
657
|
+
if (environment === "gov") {
|
|
658
|
+
if (region !== "kr1") throw new NhnCloudCliError(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uACF5\uACF5\uB9DD NCR region \uC785\uB2C8\uB2E4: "${region}". \uC0AC\uC6A9 \uAC00\uB2A5\uD55C region: kr1`, EXIT_PARAM_ERROR);
|
|
659
|
+
return "kr1-ncr.api.gov-nhncloudservice.com";
|
|
660
|
+
}
|
|
625
661
|
const host = NCR_HOST[region];
|
|
626
662
|
if (!host) {
|
|
627
663
|
throw new NhnCloudCliError(
|
|
@@ -631,7 +667,8 @@ function ncrHost(region) {
|
|
|
631
667
|
}
|
|
632
668
|
return host;
|
|
633
669
|
}
|
|
634
|
-
function instanceHost(region) {
|
|
670
|
+
function instanceHost(region, environment = "real") {
|
|
671
|
+
if (environment === "gov") return govIaasHost(region, "instance");
|
|
635
672
|
const host = INSTANCE_HOST[region];
|
|
636
673
|
if (!host) {
|
|
637
674
|
throw new NhnCloudCliError(
|
|
@@ -641,7 +678,8 @@ function instanceHost(region) {
|
|
|
641
678
|
}
|
|
642
679
|
return host;
|
|
643
680
|
}
|
|
644
|
-
function imageHost(region) {
|
|
681
|
+
function imageHost(region, environment = "real") {
|
|
682
|
+
if (environment === "gov") return govIaasHost(region, "image");
|
|
645
683
|
const host = IMAGE_HOST[region];
|
|
646
684
|
if (!host) {
|
|
647
685
|
throw new NhnCloudCliError(
|
|
@@ -651,7 +689,8 @@ function imageHost(region) {
|
|
|
651
689
|
}
|
|
652
690
|
return host;
|
|
653
691
|
}
|
|
654
|
-
function networkHost(region) {
|
|
692
|
+
function networkHost(region, environment = "real") {
|
|
693
|
+
if (environment === "gov") return govIaasHost(region, "network");
|
|
655
694
|
const host = NETWORK_HOST[region];
|
|
656
695
|
if (!host) {
|
|
657
696
|
throw new NhnCloudCliError(
|
|
@@ -661,7 +700,8 @@ function networkHost(region) {
|
|
|
661
700
|
}
|
|
662
701
|
return host;
|
|
663
702
|
}
|
|
664
|
-
function blockStorageHost(region) {
|
|
703
|
+
function blockStorageHost(region, environment = "real") {
|
|
704
|
+
if (environment === "gov") return govIaasHost(region, "block-storage");
|
|
665
705
|
const host = BLOCKSTORAGE_HOST[region];
|
|
666
706
|
if (!host) {
|
|
667
707
|
throw new NhnCloudCliError(
|
|
@@ -671,7 +711,8 @@ function blockStorageHost(region) {
|
|
|
671
711
|
}
|
|
672
712
|
return host;
|
|
673
713
|
}
|
|
674
|
-
function nksHost(region) {
|
|
714
|
+
function nksHost(region, environment = "real") {
|
|
715
|
+
if (environment === "gov") return govIaasHost(region, "kubernetes");
|
|
675
716
|
const host = NKS_HOST[region];
|
|
676
717
|
if (!host) {
|
|
677
718
|
throw new NhnCloudCliError(
|
|
@@ -721,9 +762,9 @@ function isKeystoneTokenResponse(val) {
|
|
|
721
762
|
const token = access["token"];
|
|
722
763
|
return typeof token["id"] === "string" && typeof token["expires"] === "string";
|
|
723
764
|
}
|
|
724
|
-
async function getIaasToken(profile, iaas, forceRefresh = false) {
|
|
765
|
+
async function getIaasToken(profile, iaas, forceRefresh = false, environment = "real") {
|
|
725
766
|
const credentialHash = credentialFingerprint(
|
|
726
|
-
JSON.stringify([iaas.tenantId, iaas.username, iaas.password])
|
|
767
|
+
JSON.stringify([environment, iaas.tenantId, iaas.username, iaas.password])
|
|
727
768
|
);
|
|
728
769
|
if (!forceRefresh) {
|
|
729
770
|
const cached = await readIaasToken(profile, iaas.region, credentialHash);
|
|
@@ -738,15 +779,15 @@ async function getIaasToken(profile, iaas, forceRefresh = false) {
|
|
|
738
779
|
};
|
|
739
780
|
}
|
|
740
781
|
}
|
|
741
|
-
const host = instanceHost(iaas.region);
|
|
782
|
+
const host = instanceHost(iaas.region, environment);
|
|
742
783
|
const computeEndpoint = `https://${host}/v2/${encodeURIComponent(iaas.tenantId)}`;
|
|
743
|
-
const imageEndpoint = `https://${imageHost(iaas.region)}/v2`;
|
|
744
|
-
const networkEndpoint = `https://${networkHost(iaas.region)}/v2.0`;
|
|
745
|
-
const blockStorageEndpoint = `https://${blockStorageHost(iaas.region)}/v2/${encodeURIComponent(iaas.tenantId)}`;
|
|
746
|
-
const nksEndpoint = `https://${nksHost(iaas.region)}/v1`;
|
|
784
|
+
const imageEndpoint = `https://${imageHost(iaas.region, environment)}/v2`;
|
|
785
|
+
const networkEndpoint = `https://${networkHost(iaas.region, environment)}/v2.0`;
|
|
786
|
+
const blockStorageEndpoint = `https://${blockStorageHost(iaas.region, environment)}/v2/${encodeURIComponent(iaas.tenantId)}`;
|
|
787
|
+
const nksEndpoint = `https://${nksHost(iaas.region, environment)}/v1`;
|
|
747
788
|
let raw;
|
|
748
789
|
try {
|
|
749
|
-
raw = await import_ky3.default.post(keystoneIdentityUrl(), {
|
|
790
|
+
raw = await import_ky3.default.post(keystoneIdentityUrl(environment), {
|
|
750
791
|
json: {
|
|
751
792
|
auth: {
|
|
752
793
|
tenantId: iaas.tenantId,
|
|
@@ -1007,10 +1048,10 @@ var NcrClient = class {
|
|
|
1007
1048
|
uakId;
|
|
1008
1049
|
uakSecret;
|
|
1009
1050
|
baseUrl;
|
|
1010
|
-
constructor(uakId, uakSecret, region) {
|
|
1051
|
+
constructor(uakId, uakSecret, region, environment = "real") {
|
|
1011
1052
|
this.uakId = uakId;
|
|
1012
1053
|
this.uakSecret = uakSecret;
|
|
1013
|
-
this.baseUrl = `https://${ncrHost(region)}`;
|
|
1054
|
+
this.baseUrl = `https://${ncrHost(region, environment)}`;
|
|
1014
1055
|
}
|
|
1015
1056
|
authHeaders() {
|
|
1016
1057
|
return {
|
|
@@ -1970,6 +2011,12 @@ async function verifyLogncrash(uak, appkey) {
|
|
|
1970
2011
|
// src/commands/configure.ts
|
|
1971
2012
|
async function saveAndVerify(profileName, uak, logncrash, iaas, ncr, ncs, apigateway, deploy, doVerify, logncrashUak = uak) {
|
|
1972
2013
|
if (doVerify) {
|
|
2014
|
+
if (await getProfileEnvironment(profileName, true) === "gov") {
|
|
2015
|
+
throw new NhnCloudCliError(
|
|
2016
|
+
"\uACF5\uACF5\uB9DD profile\uC740 configure \uC5F0\uACB0 \uD14C\uC2A4\uD2B8\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. --no-verify\uB85C \uC800\uC7A5\uD55C \uB4A4 \uC870\uD68C \uBA85\uB839\uC73C\uB85C \uD655\uC778\uD558\uC138\uC694.",
|
|
2017
|
+
EXIT_CONFIG_ERROR
|
|
2018
|
+
);
|
|
2019
|
+
}
|
|
1973
2020
|
if (uak) {
|
|
1974
2021
|
const ok = await verifyUserAccessKey(uak);
|
|
1975
2022
|
if (ok) {
|
|
@@ -3364,6 +3411,7 @@ function assertAvailableSearchToken(status) {
|
|
|
3364
3411
|
// src/commands/logncrash/helpers.ts
|
|
3365
3412
|
async function resolveLogncrashClient(profile) {
|
|
3366
3413
|
const profileName = await resolveProfileName(profile);
|
|
3414
|
+
await requireRealEnvironment(profileName, "Log & Crash");
|
|
3367
3415
|
const credential = await getServiceCredential("logncrash", profileName);
|
|
3368
3416
|
if (typeof credential.appkey !== "string" || credential.appkey.length === 0) {
|
|
3369
3417
|
throw new NhnCloudCliError(
|
|
@@ -3523,6 +3571,7 @@ var sendCommand = new import_commander6.Command("send").description("\uB85C\uADF
|
|
|
3523
3571
|
logLevel = upper;
|
|
3524
3572
|
}
|
|
3525
3573
|
const profileName = await resolveProfileName(opts.profile);
|
|
3574
|
+
await requireRealEnvironment(profileName, "Log & Crash");
|
|
3526
3575
|
const cred = await getServiceCredential("logncrash", profileName);
|
|
3527
3576
|
if (!cred.appkey) {
|
|
3528
3577
|
throw new NhnCloudCliError(
|
|
@@ -3864,6 +3913,11 @@ function isBinaryGroup(val) {
|
|
|
3864
3913
|
const descriptionType = typeof obj["description"];
|
|
3865
3914
|
return (keyType === "number" || keyType === "string") && typeof obj["name"] === "string" && (descriptionType === "undefined" || descriptionType === "string" || obj["description"] === null);
|
|
3866
3915
|
}
|
|
3916
|
+
function isScenario(val) {
|
|
3917
|
+
if (typeof val !== "object" || val === null) return false;
|
|
3918
|
+
const obj = val;
|
|
3919
|
+
return typeof obj["scenarioId"] === "number" && typeof obj["scenarioName"] === "string";
|
|
3920
|
+
}
|
|
3867
3921
|
function isBinary(val) {
|
|
3868
3922
|
if (typeof val !== "object" || val === null) return false;
|
|
3869
3923
|
const obj = val;
|
|
@@ -3874,9 +3928,9 @@ function isBinary(val) {
|
|
|
3874
3928
|
var DeployClient = class {
|
|
3875
3929
|
accessToken;
|
|
3876
3930
|
baseUrl;
|
|
3877
|
-
constructor(accessToken) {
|
|
3931
|
+
constructor(accessToken, environment = "real") {
|
|
3878
3932
|
this.accessToken = accessToken;
|
|
3879
|
-
this.baseUrl = endpointFor("deploy");
|
|
3933
|
+
this.baseUrl = endpointFor("deploy", environment);
|
|
3880
3934
|
}
|
|
3881
3935
|
authHeaders() {
|
|
3882
3936
|
return {
|
|
@@ -3948,6 +4002,24 @@ var DeployClient = class {
|
|
|
3948
4002
|
throw toNhnCloudCliError(err);
|
|
3949
4003
|
}
|
|
3950
4004
|
}
|
|
4005
|
+
/** 공공망과 일반망 Deploy v2.1의 서버 그룹 시나리오 목록을 조회한다. */
|
|
4006
|
+
async scenarios(appKey, artifactId, serverGroupId) {
|
|
4007
|
+
const url = `${this.baseUrl}/api/v2.1/projects/${encodeURIComponent(appKey)}/artifacts/${encodeURIComponent(artifactId)}/server-groups/${encodeURIComponent(serverGroupId)}/scenarios`;
|
|
4008
|
+
try {
|
|
4009
|
+
const res = await import_ky8.default.get(url, {
|
|
4010
|
+
headers: this.authHeaders(),
|
|
4011
|
+
retry: 0,
|
|
4012
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
4013
|
+
}).json();
|
|
4014
|
+
const body = unwrap(res);
|
|
4015
|
+
if (!Array.isArray(body.scenarios) || !body.scenarios.every(isScenario)) {
|
|
4016
|
+
throw new NhnCloudCliError("scenarios \uC751\uB2F5 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 scenarios \uBC30\uC5F4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_API_ERROR);
|
|
4017
|
+
}
|
|
4018
|
+
return body.scenarios;
|
|
4019
|
+
} catch (err) {
|
|
4020
|
+
throw toNhnCloudCliError(err);
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
3951
4023
|
/**
|
|
3952
4024
|
* 배포 이력을 조회한다.
|
|
3953
4025
|
*/
|
|
@@ -4104,8 +4176,9 @@ async function resolveServiceAppKey(service, profileName, missingMessage) {
|
|
|
4104
4176
|
async function createDeployClient(profileOpt) {
|
|
4105
4177
|
const profileName = await resolveProfileName(profileOpt);
|
|
4106
4178
|
const uak = await getUserAccessKey(profileName);
|
|
4107
|
-
const
|
|
4108
|
-
|
|
4179
|
+
const environment = await getProfileEnvironment(profileName);
|
|
4180
|
+
const accessToken = await getAccessToken(profileName, uak.id, uak.secret, false, environment);
|
|
4181
|
+
return { client: new DeployClient(accessToken, environment), profileName };
|
|
4109
4182
|
}
|
|
4110
4183
|
async function resolveDeployAppKey(profileName) {
|
|
4111
4184
|
return resolveServiceAppKey(
|
|
@@ -4211,9 +4284,34 @@ var serverGroupsCommand = new import_commander11.Command("server-groups").descri
|
|
|
4211
4284
|
});
|
|
4212
4285
|
});
|
|
4213
4286
|
|
|
4214
|
-
// src/commands/deploy/
|
|
4287
|
+
// src/commands/deploy/scenarios.ts
|
|
4215
4288
|
var import_commander12 = require("commander");
|
|
4216
|
-
var
|
|
4289
|
+
var scenariosCommand = new import_commander12.Command("scenarios").description("\uC11C\uBC84\uADF8\uB8F9 \uC2DC\uB098\uB9AC\uC624 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC544\uD2F0\uD329\uD2B8 ID").option("--server-group-id <id>", "\uC11C\uBC84\uADF8\uB8F9 ID").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4290
|
+
const opts = cmd.optsWithGlobals();
|
|
4291
|
+
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4292
|
+
const serverGroupId = requireCoordinate(opts.serverGroupId, "--server-group-id");
|
|
4293
|
+
const { client, profileName } = await createDeployClient(opts.profile);
|
|
4294
|
+
const appKey = await resolveDeployAppKey(profileName);
|
|
4295
|
+
startSpinner("\uC2DC\uB098\uB9AC\uC624 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4296
|
+
let scenarios;
|
|
4297
|
+
try {
|
|
4298
|
+
scenarios = await client.scenarios(appKey, artifactId, serverGroupId);
|
|
4299
|
+
} catch (err) {
|
|
4300
|
+
stopSpinner(false);
|
|
4301
|
+
throw err;
|
|
4302
|
+
}
|
|
4303
|
+
stopSpinner(true);
|
|
4304
|
+
output(opts, {
|
|
4305
|
+
headers: ["scenarioId", "scenarioName"],
|
|
4306
|
+
rows: scenarios.map((scenario) => [String(scenario.scenarioId), scenario.scenarioName]),
|
|
4307
|
+
raw: scenarios,
|
|
4308
|
+
ids: scenarios.map((scenario) => String(scenario.scenarioId))
|
|
4309
|
+
});
|
|
4310
|
+
});
|
|
4311
|
+
|
|
4312
|
+
// src/commands/deploy/histories.ts
|
|
4313
|
+
var import_commander13 = require("commander");
|
|
4314
|
+
var historiesCommand = new import_commander13.Command("histories").description("\uBC30\uD3EC \uC774\uB825\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4217
4315
|
const opts = cmd.optsWithGlobals();
|
|
4218
4316
|
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4219
4317
|
const { client, profileName } = await createDeployClient(opts.profile);
|
|
@@ -4236,8 +4334,8 @@ var historiesCommand = new import_commander12.Command("histories").description("
|
|
|
4236
4334
|
});
|
|
4237
4335
|
|
|
4238
4336
|
// src/commands/deploy/binary-groups.ts
|
|
4239
|
-
var
|
|
4240
|
-
var binaryGroupsCommand = new
|
|
4337
|
+
var import_commander14 = require("commander");
|
|
4338
|
+
var binaryGroupsCommand = new import_commander14.Command("binary-groups").description("\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4241
4339
|
const opts = cmd.optsWithGlobals();
|
|
4242
4340
|
const artifactId = requireCoordinate(opts.artifactId, "--artifact-id");
|
|
4243
4341
|
const { client, profileName } = await createDeployClient(opts.profile);
|
|
@@ -4268,7 +4366,7 @@ var binaryGroupsCommand = new import_commander13.Command("binary-groups").descri
|
|
|
4268
4366
|
});
|
|
4269
4367
|
|
|
4270
4368
|
// src/commands/deploy/binaries.ts
|
|
4271
|
-
var
|
|
4369
|
+
var import_commander15 = require("commander");
|
|
4272
4370
|
function parsePositiveInt(value, flag) {
|
|
4273
4371
|
if (value === void 0) return void 0;
|
|
4274
4372
|
if (!/^[1-9]\d*$/.test(value)) {
|
|
@@ -4279,7 +4377,7 @@ function parsePositiveInt(value, flag) {
|
|
|
4279
4377
|
}
|
|
4280
4378
|
return Number(value);
|
|
4281
4379
|
}
|
|
4282
|
-
var binariesCommand = new
|
|
4380
|
+
var binariesCommand = new import_commander15.Command("binaries").description("\uD2B9\uC815 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC758 \uBC14\uC774\uB108\uB9AC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").requiredOption("--binary-group <key>", "\uC870\uD68C\uD560 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").option("--page-num <n>", "\uD398\uC774\uC9C0 \uBC88\uD638 (1 \uC774\uC0C1)").option("--page-size <n>", "\uD398\uC774\uC9C0 \uD06C\uAE30 (1 \uC774\uC0C1)").option("--sort-key <k>", "\uC815\uB82C \uAE30\uC900 (\uC608: UPLOAD_DATE)").option("--sort-direction <d>", "\uC815\uB82C \uBC29\uD5A5 (\uC608: DESC)").option("--artifact-id <id>", "\uC870\uD68C\uD560 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4283
4381
|
const opts = cmd.optsWithGlobals();
|
|
4284
4382
|
const binaryGroupKey = parsePositiveInt(opts.binaryGroup, "--binary-group");
|
|
4285
4383
|
if (binaryGroupKey === void 0) {
|
|
@@ -4323,7 +4421,7 @@ var binariesCommand = new import_commander14.Command("binaries").description("\u
|
|
|
4323
4421
|
});
|
|
4324
4422
|
|
|
4325
4423
|
// src/commands/deploy/upload.ts
|
|
4326
|
-
var
|
|
4424
|
+
var import_commander16 = require("commander");
|
|
4327
4425
|
var import_node_fs5 = require("fs");
|
|
4328
4426
|
var import_node_path7 = require("path");
|
|
4329
4427
|
var MAX_UPLOAD_BYTES = 512 * 1024 * 1024;
|
|
@@ -4337,7 +4435,7 @@ function parsePositiveInt2(value, flag) {
|
|
|
4337
4435
|
}
|
|
4338
4436
|
return Number(value);
|
|
4339
4437
|
}
|
|
4340
|
-
var uploadCommand = new
|
|
4438
|
+
var uploadCommand = new import_commander16.Command("upload").description("\uB85C\uCEEC \uD30C\uC77C\uC744 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9\uC5D0 \uC5C5\uB85C\uB4DC\uD55C\uB2E4").requiredOption("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C").requiredOption("--binary-group <key>", "\uC5C5\uB85C\uB4DC \uB300\uC0C1 \uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").option("--application-type <type>", "applicationType (\uC608: server)", "server").option("--description <text>", "\uBC14\uC774\uB108\uB9AC \uC124\uBA85").option("--artifact-id <id>", "\uC5C5\uB85C\uB4DC \uB300\uC0C1 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4341
4439
|
const opts = cmd.optsWithGlobals();
|
|
4342
4440
|
const binaryGroupKey = parsePositiveInt2(opts.binaryGroup, "--binary-group");
|
|
4343
4441
|
if (binaryGroupKey === void 0) {
|
|
@@ -4398,7 +4496,7 @@ var uploadCommand = new import_commander15.Command("upload").description("\uB85C
|
|
|
4398
4496
|
});
|
|
4399
4497
|
|
|
4400
4498
|
// src/commands/deploy/download.ts
|
|
4401
|
-
var
|
|
4499
|
+
var import_commander17 = require("commander");
|
|
4402
4500
|
var import_node_fs6 = require("fs");
|
|
4403
4501
|
var import_chalk4 = __toESM(require("chalk"));
|
|
4404
4502
|
function parsePositiveInt3(value, flag) {
|
|
@@ -4428,7 +4526,7 @@ function assertWritable2(path5, force) {
|
|
|
4428
4526
|
EXIT_PARAM_ERROR
|
|
4429
4527
|
);
|
|
4430
4528
|
}
|
|
4431
|
-
var downloadCommand = new
|
|
4529
|
+
var downloadCommand = new import_commander17.Command("download").description("\uBC14\uC774\uB108\uB9AC\uB97C \uB85C\uCEEC \uD30C\uC77C\uB85C \uB2E4\uC6B4\uB85C\uB4DC\uD55C\uB2E4").requiredOption("--binary-group <key>", "\uBC14\uC774\uB108\uB9AC \uADF8\uB8F9 key (binary-groups \uB85C \uD655\uC778)").requiredOption("--binary-key <key>", "\uB2E4\uC6B4\uB85C\uB4DC\uD560 \uBC14\uC774\uB108\uB9AC key (binaries \uB610\uB294 upload \uB85C \uD655\uC778)").requiredOption("-o, --output <file>", "\uC800\uC7A5\uD560 \uD30C\uC77C \uACBD\uB85C").option("--force", "\uB300\uC0C1 \uD30C\uC77C\uC774 \uC788\uC73C\uBA74 \uB36E\uC5B4\uC4F4\uB2E4").option("--artifact-id <id>", "\uB300\uC0C1 \uC544\uD2F0\uD329\uD2B8 ID (artifacts \uB85C \uD655\uC778)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
4432
4530
|
const opts = cmd.optsWithGlobals();
|
|
4433
4531
|
const binaryGroupKey = parsePositiveInt3(opts.binaryGroup, "--binary-group");
|
|
4434
4532
|
const binaryKey = parsePositiveInt3(opts.binaryKey, "--binary-key");
|
|
@@ -4456,14 +4554,15 @@ var downloadCommand = new import_commander16.Command("download").description("\u
|
|
|
4456
4554
|
});
|
|
4457
4555
|
|
|
4458
4556
|
// src/commands/instance/list.ts
|
|
4459
|
-
var
|
|
4557
|
+
var import_commander18 = require("commander");
|
|
4460
4558
|
|
|
4461
4559
|
// src/commands/iaas.ts
|
|
4462
4560
|
async function resolveIaasTokenContext(opts) {
|
|
4463
4561
|
const profileName = await resolveProfileName(opts.profile);
|
|
4464
4562
|
const iaas = await getIaasCredential(profileName);
|
|
4465
4563
|
const effectiveIaas = opts.region ? { ...iaas, region: opts.region } : iaas;
|
|
4466
|
-
const
|
|
4564
|
+
const environment = await getProfileEnvironment(profileName);
|
|
4565
|
+
const tokenContext = await getIaasToken(profileName, effectiveIaas, false, environment);
|
|
4467
4566
|
return { profileName, ...tokenContext };
|
|
4468
4567
|
}
|
|
4469
4568
|
|
|
@@ -4729,6 +4828,14 @@ var InstanceClient = class {
|
|
|
4729
4828
|
throw toNhnCloudCliError(err);
|
|
4730
4829
|
}
|
|
4731
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
|
+
}
|
|
4732
4839
|
/** 인스턴스를 시작한다 (SHUTOFF → ACTIVE). */
|
|
4733
4840
|
async start(id) {
|
|
4734
4841
|
return this.serverAction(id, { "os-start": null });
|
|
@@ -5021,7 +5128,7 @@ async function resolveInstanceClient(opts) {
|
|
|
5021
5128
|
function getIps(server) {
|
|
5022
5129
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
5023
5130
|
}
|
|
5024
|
-
var listCommand = new
|
|
5131
|
+
var listCommand = new import_commander18.Command("list").description("\uC778\uC2A4\uD134\uC2A4 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5025
5132
|
const opts = cmd.optsWithGlobals();
|
|
5026
5133
|
const { client } = await resolveInstanceClient(opts);
|
|
5027
5134
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5042,7 +5149,7 @@ var listCommand = new import_commander17.Command("list").description("\uC778\uC2
|
|
|
5042
5149
|
});
|
|
5043
5150
|
|
|
5044
5151
|
// src/commands/volume/list.ts
|
|
5045
|
-
var
|
|
5152
|
+
var import_commander19 = require("commander");
|
|
5046
5153
|
|
|
5047
5154
|
// src/services/blockstorage/client.ts
|
|
5048
5155
|
var import_ky10 = __toESM(require("ky"));
|
|
@@ -5160,7 +5267,7 @@ function parsePositiveInt4(value, flag) {
|
|
|
5160
5267
|
}
|
|
5161
5268
|
return Number(value);
|
|
5162
5269
|
}
|
|
5163
|
-
var listCommand2 = new
|
|
5270
|
+
var listCommand2 = new import_commander19.Command("list").description("\uBCFC\uB968 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4").option("--sort <key:dir>", "\uC815\uB82C \uAE30\uC900 (\uC608: created_at:desc)").option("--limit <n>", "\uCD5C\uB300 \uBC18\uD658 \uAC1C\uC218").option("--offset <n>", "\uD398\uC774\uC9C0 \uC2DC\uC791 \uC624\uD504\uC14B").option("--marker <id>", "\uD398\uC774\uC9C0\uB124\uC774\uC158 \uB9C8\uCEE4 \uBCFC\uB968 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5164
5271
|
const opts = cmd.optsWithGlobals();
|
|
5165
5272
|
const limitNum = opts.limit !== void 0 ? parsePositiveInt4(opts.limit, "--limit") : void 0;
|
|
5166
5273
|
const offsetNum = opts.offset !== void 0 ? parsePositiveInt4(opts.offset, "--offset") : void 0;
|
|
@@ -5194,8 +5301,8 @@ var listCommand2 = new import_commander18.Command("list").description("\uBCFC\uB
|
|
|
5194
5301
|
});
|
|
5195
5302
|
|
|
5196
5303
|
// src/commands/volume/get.ts
|
|
5197
|
-
var
|
|
5198
|
-
var getCommand = new
|
|
5304
|
+
var import_commander20 = require("commander");
|
|
5305
|
+
var getCommand = new import_commander20.Command("get").description("\uB2E8\uC77C \uBCFC\uB968 \uC0C1\uD0DC\uB97C \uC870\uD68C\uD55C\uB2E4").argument("<id>", "\uBCFC\uB968 ID").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (id, _opts, cmd) => {
|
|
5199
5306
|
const opts = cmd.optsWithGlobals();
|
|
5200
5307
|
const { client } = await resolveVolumeClient(opts);
|
|
5201
5308
|
startSpinner("\uBCFC\uB968 \uC870\uD68C \uC911...");
|
|
@@ -5226,9 +5333,9 @@ var getCommand = new import_commander19.Command("get").description("\uB2E8\uC77C
|
|
|
5226
5333
|
});
|
|
5227
5334
|
|
|
5228
5335
|
// src/commands/volume/create.ts
|
|
5229
|
-
var
|
|
5336
|
+
var import_commander21 = require("commander");
|
|
5230
5337
|
var import_chalk5 = __toESM(require("chalk"));
|
|
5231
|
-
var createCommand = new
|
|
5338
|
+
var createCommand = new import_commander21.Command("create").description("\uBCFC\uB968\uC744 \uBC1C\uAE09\uD55C\uB2E4").requiredOption("--size <gb>", "\uBCFC\uB968 \uD06C\uAE30(GB) \u2014 \uD544\uC218").option("--name <name>", "\uBCFC\uB968 \uC774\uB984").option("--description <text>", "\uBCFC\uB968 \uC124\uBA85").option("--volume-type <type>", "\uBCFC\uB968 \uD0C0\uC785").option("--availability-zone <az>", "\uAC00\uC6A9\uC131 \uC601\uC5ED(AZ). instance availability-zones \uB85C \uC870\uD68C\uD55C zoneName \uC9C0\uC815").option("--snapshot-id <id>", "\uC2A4\uB0C5\uC0F7 ID (\uC2A4\uB0C5\uC0F7\uC5D0\uC11C \uBCFC\uB968 \uC0DD\uC131)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5232
5339
|
const opts = cmd.optsWithGlobals();
|
|
5233
5340
|
if (!/^[1-9]\d*$/.test(opts.size)) {
|
|
5234
5341
|
throw new NhnCloudCliError(
|
|
@@ -5281,10 +5388,39 @@ var createCommand = new import_commander20.Command("create").description("\uBCFC
|
|
|
5281
5388
|
});
|
|
5282
5389
|
|
|
5283
5390
|
// src/commands/network/list.ts
|
|
5284
|
-
var
|
|
5391
|
+
var import_commander22 = require("commander");
|
|
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
|
+
}
|
|
5285
5422
|
|
|
5286
5423
|
// src/services/network/client.ts
|
|
5287
|
-
var import_ky11 = __toESM(require("ky"));
|
|
5288
5424
|
function isVpc(val) {
|
|
5289
5425
|
if (typeof val !== "object" || val === null) return false;
|
|
5290
5426
|
const obj = val;
|
|
@@ -5320,6 +5456,28 @@ function isFloatingIpResponse(val) {
|
|
|
5320
5456
|
const obj = val;
|
|
5321
5457
|
return isFloatingIp(obj["floatingip"]);
|
|
5322
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
|
+
}
|
|
5323
5481
|
var NetworkClient = class {
|
|
5324
5482
|
tokenId;
|
|
5325
5483
|
networkEndpoint;
|
|
@@ -5330,6 +5488,184 @@ var NetworkClient = class {
|
|
|
5330
5488
|
authHeaders() {
|
|
5331
5489
|
return { "X-Auth-Token": this.tokenId };
|
|
5332
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
|
+
}
|
|
5333
5669
|
/**
|
|
5334
5670
|
* VPC 목록을 조회한다 (GET /v2.0/vpcs, NHN VPC).
|
|
5335
5671
|
* instance 와 다른 host(networkEndpoint)지만 같은 Keystone 토큰을 쓴다.
|
|
@@ -5337,7 +5673,7 @@ var NetworkClient = class {
|
|
|
5337
5673
|
async listVpcs() {
|
|
5338
5674
|
const url = `${this.networkEndpoint}/vpcs`;
|
|
5339
5675
|
try {
|
|
5340
|
-
const raw = await
|
|
5676
|
+
const raw = await import_ky12.default.get(url, {
|
|
5341
5677
|
headers: this.authHeaders(),
|
|
5342
5678
|
retry: 0,
|
|
5343
5679
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -5359,7 +5695,7 @@ var NetworkClient = class {
|
|
|
5359
5695
|
async listSubnets() {
|
|
5360
5696
|
const url = `${this.networkEndpoint}/vpcsubnets`;
|
|
5361
5697
|
try {
|
|
5362
|
-
const raw = await
|
|
5698
|
+
const raw = await import_ky12.default.get(url, {
|
|
5363
5699
|
headers: this.authHeaders(),
|
|
5364
5700
|
retry: 0,
|
|
5365
5701
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -5379,7 +5715,7 @@ var NetworkClient = class {
|
|
|
5379
5715
|
async listFloatingIps() {
|
|
5380
5716
|
const url = `${this.networkEndpoint}/floatingips`;
|
|
5381
5717
|
try {
|
|
5382
|
-
const raw = await
|
|
5718
|
+
const raw = await import_ky12.default.get(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS }).json();
|
|
5383
5719
|
if (!isFloatingIpsResponse(raw)) {
|
|
5384
5720
|
throw new NhnCloudCliError(
|
|
5385
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.",
|
|
@@ -5395,7 +5731,7 @@ var NetworkClient = class {
|
|
|
5395
5731
|
async createFloatingIp(params) {
|
|
5396
5732
|
const url = `${this.networkEndpoint}/floatingips`;
|
|
5397
5733
|
try {
|
|
5398
|
-
const raw = await
|
|
5734
|
+
const raw = await import_ky12.default.post(url, {
|
|
5399
5735
|
headers: this.authHeaders(),
|
|
5400
5736
|
json: { floatingip: { floating_network_id: params.floating_network_id } },
|
|
5401
5737
|
retry: 0,
|
|
@@ -5416,7 +5752,7 @@ var NetworkClient = class {
|
|
|
5416
5752
|
async deleteFloatingIp(id) {
|
|
5417
5753
|
const url = `${this.networkEndpoint}/floatingips/${encodeURIComponent(id)}`;
|
|
5418
5754
|
try {
|
|
5419
|
-
await
|
|
5755
|
+
await import_ky12.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
5420
5756
|
} catch (err) {
|
|
5421
5757
|
throw toNhnCloudCliError(err);
|
|
5422
5758
|
}
|
|
@@ -5430,7 +5766,7 @@ var NetworkClient = class {
|
|
|
5430
5766
|
async findExternalNetworkId() {
|
|
5431
5767
|
const url = `${this.networkEndpoint}/vpcs`;
|
|
5432
5768
|
try {
|
|
5433
|
-
const raw = await
|
|
5769
|
+
const raw = await import_ky12.default.get(url, {
|
|
5434
5770
|
headers: this.authHeaders(),
|
|
5435
5771
|
searchParams: { "router:external": "true" },
|
|
5436
5772
|
retry: 0,
|
|
@@ -5451,67 +5787,531 @@ var NetworkClient = class {
|
|
|
5451
5787
|
throw toNhnCloudCliError(err);
|
|
5452
5788
|
}
|
|
5453
5789
|
}
|
|
5454
|
-
};
|
|
5790
|
+
};
|
|
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
|
+
|
|
5834
|
+
// src/commands/network/helpers.ts
|
|
5835
|
+
async function resolveNetworkClient(opts) {
|
|
5836
|
+
const { profileName, tokenId, networkEndpoint } = await resolveIaasTokenContext(opts);
|
|
5837
|
+
return { client: new NetworkClient(tokenId, networkEndpoint), profileName };
|
|
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
|
+
}
|
|
5946
|
+
|
|
5947
|
+
// src/commands/network/list.ts
|
|
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) => {
|
|
5949
|
+
const opts = cmd.optsWithGlobals();
|
|
5950
|
+
const { client } = await resolveNetworkClient(opts);
|
|
5951
|
+
startSpinner("VPC \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
5952
|
+
let vpcs;
|
|
5953
|
+
try {
|
|
5954
|
+
vpcs = await client.listVpcs();
|
|
5955
|
+
} catch (err) {
|
|
5956
|
+
stopSpinner(false);
|
|
5957
|
+
throw err;
|
|
5958
|
+
}
|
|
5959
|
+
stopSpinner(true);
|
|
5960
|
+
output(opts, {
|
|
5961
|
+
headers: ["id", "name", "cidrv4", "state", "external"],
|
|
5962
|
+
rows: vpcs.map((v) => [v.id, v.name, v.cidrv4, v.state, String(v["router:external"])]),
|
|
5963
|
+
raw: vpcs,
|
|
5964
|
+
ids: vpcs.map((v) => v.id)
|
|
5965
|
+
});
|
|
5966
|
+
});
|
|
5967
|
+
|
|
5968
|
+
// src/commands/network/subnet.ts
|
|
5969
|
+
var import_commander23 = require("commander");
|
|
5970
|
+
var subnetListCommand = new import_commander23.Command("list").description("\uC11C\uBE0C\uB137 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
5971
|
+
const opts = cmd.optsWithGlobals();
|
|
5972
|
+
const { client } = await resolveNetworkClient(opts);
|
|
5973
|
+
startSpinner("\uC11C\uBE0C\uB137 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
5974
|
+
let subnets;
|
|
5975
|
+
try {
|
|
5976
|
+
subnets = await client.listSubnets();
|
|
5977
|
+
} catch (err) {
|
|
5978
|
+
stopSpinner(false);
|
|
5979
|
+
throw err;
|
|
5980
|
+
}
|
|
5981
|
+
stopSpinner(true);
|
|
5982
|
+
output(opts, {
|
|
5983
|
+
headers: ["id", "cidr", "vpc_id", "gateway", "available_ip"],
|
|
5984
|
+
rows: subnets.map((s) => [
|
|
5985
|
+
s.id,
|
|
5986
|
+
s.cidr,
|
|
5987
|
+
s.vpc_id,
|
|
5988
|
+
s.gateway,
|
|
5989
|
+
String(s.available_ip_count)
|
|
5990
|
+
]),
|
|
5991
|
+
raw: subnets,
|
|
5992
|
+
ids: subnets.map((s) => s.id)
|
|
5993
|
+
});
|
|
5994
|
+
});
|
|
5995
|
+
var subnetCommand = new import_commander23.Command("subnet").description("\uC11C\uBE0C\uB137 \uAD00\uB828 \uBA85\uB839").addCommand(subnetListCommand);
|
|
5996
|
+
|
|
5997
|
+
// src/commands/network/security-group.ts
|
|
5998
|
+
var import_commander26 = require("commander");
|
|
5999
|
+
|
|
6000
|
+
// src/commands/network/security-group-manage.ts
|
|
6001
|
+
var import_commander24 = require("commander");
|
|
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
|
+
});
|
|
5455
6109
|
|
|
5456
|
-
// src/commands/network/
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
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
|
+
});
|
|
5460
6129
|
}
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
var listCommand3 = new import_commander21.Command("list").description("VPC \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
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");
|
|
5464
6132
|
const opts = cmd.optsWithGlobals();
|
|
5465
|
-
const {
|
|
5466
|
-
startSpinner("
|
|
5467
|
-
let
|
|
6133
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6134
|
+
startSpinner("\uBCF4\uC548\uADF8\uB8F9 \uADDC\uCE59 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
6135
|
+
let rules;
|
|
5468
6136
|
try {
|
|
5469
|
-
|
|
6137
|
+
const id = await resolveSecurityGroupId(network, groupInput);
|
|
6138
|
+
rules = await network.listSecurityGroupRules(id);
|
|
5470
6139
|
} catch (err) {
|
|
5471
6140
|
stopSpinner(false);
|
|
5472
6141
|
throw err;
|
|
5473
6142
|
}
|
|
5474
6143
|
stopSpinner(true);
|
|
5475
6144
|
output(opts, {
|
|
5476
|
-
headers: ["id", "
|
|
5477
|
-
rows:
|
|
5478
|
-
|
|
5479
|
-
|
|
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)
|
|
5480
6157
|
});
|
|
5481
6158
|
});
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
var import_commander22 = require("commander");
|
|
5485
|
-
var subnetListCommand = new import_commander22.Command("list").description("\uC11C\uBE0C\uB137 \uBAA9\uB85D\uC744 \uC870\uD68C\uD55C\uB2E4 (\uC804\uCCB4 \uD544\uB4DC\uB294 --json)").option("--region <region>", "region override (\uAE30\uBCF8: iaas \uC790\uACA9\uC99D\uBA85\uC758 region)").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984").action(async (_opts, cmd) => {
|
|
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");
|
|
5486
6161
|
const opts = cmd.optsWithGlobals();
|
|
5487
|
-
const {
|
|
5488
|
-
startSpinner("\
|
|
5489
|
-
let
|
|
6162
|
+
const { network } = await resolveSecurityGroupClients(opts);
|
|
6163
|
+
startSpinner("\uBCF4\uC548 \uADDC\uCE59 \uC870\uD68C \uC911...");
|
|
6164
|
+
let rule;
|
|
5490
6165
|
try {
|
|
5491
|
-
|
|
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);
|
|
5492
6202
|
} catch (err) {
|
|
5493
6203
|
stopSpinner(false);
|
|
5494
6204
|
throw err;
|
|
5495
6205
|
}
|
|
5496
6206
|
stopSpinner(true);
|
|
6207
|
+
const result = { operation: "security-group-rule-delete", status: "succeeded", security_group_rule_id: ruleId };
|
|
5497
6208
|
output(opts, {
|
|
5498
|
-
headers: ["
|
|
5499
|
-
rows:
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
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(",")
|
|
5505
6305
|
]),
|
|
5506
|
-
raw:
|
|
5507
|
-
ids:
|
|
6306
|
+
raw: ports,
|
|
6307
|
+
ids: [...new Set(ports.filter((port) => port.device_owner.startsWith("compute:")).map((port) => port.device_id))]
|
|
5508
6308
|
});
|
|
5509
6309
|
});
|
|
5510
|
-
var
|
|
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);
|
|
5511
6311
|
|
|
5512
6312
|
// src/commands/floatingip/list.ts
|
|
5513
|
-
var
|
|
5514
|
-
var
|
|
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) => {
|
|
5515
6315
|
const opts = cmd.optsWithGlobals();
|
|
5516
6316
|
const { client } = await resolveNetworkClient(opts);
|
|
5517
6317
|
startSpinner("Floating IP \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -5538,9 +6338,9 @@ var listCommand4 = new import_commander23.Command("list").description("Floating
|
|
|
5538
6338
|
});
|
|
5539
6339
|
|
|
5540
6340
|
// src/commands/floatingip/create.ts
|
|
5541
|
-
var
|
|
6341
|
+
var import_commander28 = require("commander");
|
|
5542
6342
|
var import_chalk6 = __toESM(require("chalk"));
|
|
5543
|
-
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) => {
|
|
5544
6344
|
const opts = cmd.optsWithGlobals();
|
|
5545
6345
|
const { client } = await resolveNetworkClient(opts);
|
|
5546
6346
|
let networkId = opts.network;
|
|
@@ -5583,9 +6383,9 @@ var createCommand2 = new import_commander24.Command("create").description("Float
|
|
|
5583
6383
|
});
|
|
5584
6384
|
|
|
5585
6385
|
// src/commands/floatingip/delete.ts
|
|
5586
|
-
var
|
|
6386
|
+
var import_commander29 = require("commander");
|
|
5587
6387
|
var import_chalk7 = __toESM(require("chalk"));
|
|
5588
|
-
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) => {
|
|
5589
6389
|
const opts = cmd.optsWithGlobals();
|
|
5590
6390
|
const isTTY = process.stdin.isTTY;
|
|
5591
6391
|
if (!isTTY && !opts.yes) {
|
|
@@ -5619,8 +6419,8 @@ var deleteCommand = new import_commander25.Command("delete").description("Floati
|
|
|
5619
6419
|
});
|
|
5620
6420
|
|
|
5621
6421
|
// src/commands/instance/flavors.ts
|
|
5622
|
-
var
|
|
5623
|
-
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) => {
|
|
5624
6424
|
const opts = cmd.optsWithGlobals();
|
|
5625
6425
|
const minDisk = parseNonNegativeIntegerOption(opts.minDisk, "--min-disk");
|
|
5626
6426
|
const minRam = parseNonNegativeIntegerOption(opts.minRam, "--min-ram");
|
|
@@ -5663,8 +6463,8 @@ function isDetailList(flavors) {
|
|
|
5663
6463
|
}
|
|
5664
6464
|
|
|
5665
6465
|
// src/commands/instance/availability-zones.ts
|
|
5666
|
-
var
|
|
5667
|
-
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) => {
|
|
5668
6468
|
const opts = cmd.optsWithGlobals();
|
|
5669
6469
|
const { client } = await resolveInstanceClient(opts);
|
|
5670
6470
|
startSpinner("\uAC00\uC6A9\uC131 \uC601\uC5ED \uC870\uD68C \uC911...");
|
|
@@ -5685,14 +6485,14 @@ var availabilityZonesCommand = new import_commander27.Command("availability-zone
|
|
|
5685
6485
|
});
|
|
5686
6486
|
|
|
5687
6487
|
// src/commands/instance/get.ts
|
|
5688
|
-
var
|
|
6488
|
+
var import_commander32 = require("commander");
|
|
5689
6489
|
function getIps2(server) {
|
|
5690
6490
|
return Object.values(server.addresses).flat().map((a) => a.addr).join(", ");
|
|
5691
6491
|
}
|
|
5692
6492
|
function getImageId(server) {
|
|
5693
6493
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5694
6494
|
}
|
|
5695
|
-
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) => {
|
|
5696
6496
|
const opts = cmd.optsWithGlobals();
|
|
5697
6497
|
const { client } = await resolveInstanceClient(opts);
|
|
5698
6498
|
startSpinner("\uC778\uC2A4\uD134\uC2A4 \uC870\uD68C \uC911...");
|
|
@@ -5724,7 +6524,7 @@ var getCommand2 = new import_commander28.Command("get").description("\uB2E8\uC77
|
|
|
5724
6524
|
});
|
|
5725
6525
|
|
|
5726
6526
|
// src/commands/instance/create.ts
|
|
5727
|
-
var
|
|
6527
|
+
var import_commander33 = require("commander");
|
|
5728
6528
|
var import_node_fs7 = require("fs");
|
|
5729
6529
|
var import_chalk8 = __toESM(require("chalk"));
|
|
5730
6530
|
function getFirstIp(server) {
|
|
@@ -5741,7 +6541,7 @@ function getIps3(server) {
|
|
|
5741
6541
|
function getImageId2(server) {
|
|
5742
6542
|
return typeof server.image === "object" ? server.image.id : "";
|
|
5743
6543
|
}
|
|
5744
|
-
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) => {
|
|
5745
6545
|
const opts = cmd.optsWithGlobals();
|
|
5746
6546
|
const networks = opts.network ?? [];
|
|
5747
6547
|
if (networks.length === 0) {
|
|
@@ -5840,9 +6640,9 @@ var createCommand3 = new import_commander29.Command("create").description("\uC77
|
|
|
5840
6640
|
});
|
|
5841
6641
|
|
|
5842
6642
|
// src/commands/instance/delete.ts
|
|
5843
|
-
var
|
|
6643
|
+
var import_commander34 = require("commander");
|
|
5844
6644
|
var import_chalk9 = __toESM(require("chalk"));
|
|
5845
|
-
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) => {
|
|
5846
6646
|
const opts = cmd.optsWithGlobals();
|
|
5847
6647
|
const isTTY = process.stdin.isTTY;
|
|
5848
6648
|
if (!isTTY && !opts.yes) {
|
|
@@ -5876,9 +6676,9 @@ var deleteCommand2 = new import_commander30.Command("delete").description("\uC77
|
|
|
5876
6676
|
});
|
|
5877
6677
|
|
|
5878
6678
|
// src/commands/instance/power.ts
|
|
5879
|
-
var
|
|
6679
|
+
var import_commander35 = require("commander");
|
|
5880
6680
|
var import_chalk10 = __toESM(require("chalk"));
|
|
5881
|
-
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) => {
|
|
5882
6682
|
const opts = cmd.optsWithGlobals();
|
|
5883
6683
|
const { client } = await resolveInstanceClient(opts);
|
|
5884
6684
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC2DC\uC791 \uC911... (id: ${id})`);
|
|
@@ -5892,7 +6692,7 @@ var startCommand = new import_commander31.Command("start").description("\uC778\u
|
|
|
5892
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).
|
|
5893
6693
|
`));
|
|
5894
6694
|
});
|
|
5895
|
-
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) => {
|
|
5896
6696
|
const opts = cmd.optsWithGlobals();
|
|
5897
6697
|
const { client } = await resolveInstanceClient(opts);
|
|
5898
6698
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uC815\uC9C0 \uC911... (id: ${id})`);
|
|
@@ -5906,7 +6706,7 @@ var stopCommand = new import_commander31.Command("stop").description("\uC778\uC2
|
|
|
5906
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).
|
|
5907
6707
|
`));
|
|
5908
6708
|
});
|
|
5909
|
-
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) => {
|
|
5910
6710
|
const opts = cmd.optsWithGlobals();
|
|
5911
6711
|
const { client } = await resolveInstanceClient(opts);
|
|
5912
6712
|
const type = opts.hard ? "HARD" : "SOFT";
|
|
@@ -5923,9 +6723,9 @@ var rebootCommand = new import_commander31.Command("reboot").description("\uC778
|
|
|
5923
6723
|
});
|
|
5924
6724
|
|
|
5925
6725
|
// src/commands/instance/resize.ts
|
|
5926
|
-
var
|
|
6726
|
+
var import_commander36 = require("commander");
|
|
5927
6727
|
var import_chalk11 = __toESM(require("chalk"));
|
|
5928
|
-
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) => {
|
|
5929
6729
|
const opts = cmd.optsWithGlobals();
|
|
5930
6730
|
const { client } = await resolveInstanceClient(opts);
|
|
5931
6731
|
startSpinner(`\uC778\uC2A4\uD134\uC2A4 \uD0C0\uC785 \uBCC0\uACBD \uC911... (id: ${id})`);
|
|
@@ -5943,7 +6743,7 @@ var resizeCommand = new import_commander32.Command("resize").description("\uC778
|
|
|
5943
6743
|
)
|
|
5944
6744
|
);
|
|
5945
6745
|
});
|
|
5946
|
-
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) => {
|
|
5947
6747
|
const opts = cmd.optsWithGlobals();
|
|
5948
6748
|
const { client } = await resolveInstanceClient(opts);
|
|
5949
6749
|
startSpinner(`resize \uD655\uC815 \uC911... (id: ${id})`);
|
|
@@ -5957,7 +6757,7 @@ var resizeConfirmCommand = new import_commander32.Command("resize-confirm").desc
|
|
|
5957
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).
|
|
5958
6758
|
`));
|
|
5959
6759
|
});
|
|
5960
|
-
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) => {
|
|
5961
6761
|
const opts = cmd.optsWithGlobals();
|
|
5962
6762
|
const { client } = await resolveInstanceClient(opts);
|
|
5963
6763
|
startSpinner(`resize \uB864\uBC31 \uC911... (id: ${id})`);
|
|
@@ -5975,9 +6775,9 @@ var resizeRevertCommand = new import_commander32.Command("resize-revert").descri
|
|
|
5975
6775
|
});
|
|
5976
6776
|
|
|
5977
6777
|
// src/commands/instance/images.ts
|
|
5978
|
-
var
|
|
6778
|
+
var import_commander37 = require("commander");
|
|
5979
6779
|
var VISIBILITY_VALUES = ["public", "private", "shared"];
|
|
5980
|
-
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) => {
|
|
5981
6781
|
const opts = cmd.optsWithGlobals();
|
|
5982
6782
|
const limit = parsePositiveIntegerOption(opts.limit, "--limit");
|
|
5983
6783
|
if (opts.visibility !== void 0 && !VISIBILITY_VALUES.includes(opts.visibility)) {
|
|
@@ -6025,8 +6825,8 @@ var imagesCommand = new import_commander33.Command("images").description("\uC774
|
|
|
6025
6825
|
});
|
|
6026
6826
|
|
|
6027
6827
|
// src/commands/instance/keypairs.ts
|
|
6028
|
-
var
|
|
6029
|
-
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) => {
|
|
6030
6830
|
const opts = cmd.optsWithGlobals();
|
|
6031
6831
|
const { client } = await resolveInstanceClient(opts);
|
|
6032
6832
|
startSpinner("\uD0A4\uD398\uC5B4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6047,7 +6847,7 @@ var keypairsCommand = new import_commander34.Command("keypairs").description("\u
|
|
|
6047
6847
|
});
|
|
6048
6848
|
|
|
6049
6849
|
// src/commands/instance/keypair.ts
|
|
6050
|
-
var
|
|
6850
|
+
var import_commander39 = require("commander");
|
|
6051
6851
|
var import_node_fs8 = require("fs");
|
|
6052
6852
|
var import_node_crypto5 = require("crypto");
|
|
6053
6853
|
var import_chalk12 = __toESM(require("chalk"));
|
|
@@ -6090,7 +6890,7 @@ function savePrivateKey(filePath, privateKey) {
|
|
|
6090
6890
|
);
|
|
6091
6891
|
}
|
|
6092
6892
|
}
|
|
6093
|
-
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) => {
|
|
6094
6894
|
const opts = cmd.optsWithGlobals();
|
|
6095
6895
|
const { client } = await resolveInstanceClient(opts);
|
|
6096
6896
|
startSpinner("\uD0A4\uD398\uC5B4 \uC870\uD68C \uC911...");
|
|
@@ -6115,7 +6915,7 @@ var getKeypairCmd = new import_commander35.Command("get").description("\uB2E8\uC
|
|
|
6115
6915
|
ids: [kp.name]
|
|
6116
6916
|
});
|
|
6117
6917
|
});
|
|
6118
|
-
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) => {
|
|
6119
6919
|
const opts = cmd.optsWithGlobals();
|
|
6120
6920
|
const publicKey = opts.publicKey !== void 0 ? resolvePublicKey(opts.publicKey) : void 0;
|
|
6121
6921
|
if (opts.output !== void 0 && publicKey !== void 0) {
|
|
@@ -6174,7 +6974,7 @@ var createKeypairCmd = new import_commander35.Command("create").description("\uD
|
|
|
6174
6974
|
ids: [meta.name]
|
|
6175
6975
|
});
|
|
6176
6976
|
});
|
|
6177
|
-
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) => {
|
|
6178
6978
|
const opts = cmd.optsWithGlobals();
|
|
6179
6979
|
const { client } = await resolveInstanceClient(opts);
|
|
6180
6980
|
startSpinner("\uD0A4\uD398\uC5B4 \uC0AD\uC81C \uC911...");
|
|
@@ -6188,12 +6988,12 @@ var deleteKeypairCmd = new import_commander35.Command("delete").description("\uD
|
|
|
6188
6988
|
process.stderr.write(import_chalk12.default.green(`\u2713 \uD0A4\uD398\uC5B4 "${name}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
6189
6989
|
`));
|
|
6190
6990
|
});
|
|
6191
|
-
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);
|
|
6192
6992
|
|
|
6193
6993
|
// src/commands/instance/volume.ts
|
|
6194
|
-
var
|
|
6994
|
+
var import_commander40 = require("commander");
|
|
6195
6995
|
var import_chalk13 = __toESM(require("chalk"));
|
|
6196
|
-
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) => {
|
|
6197
6997
|
const opts = cmd.optsWithGlobals();
|
|
6198
6998
|
const { client } = await resolveInstanceClient(opts);
|
|
6199
6999
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uC911...");
|
|
@@ -6221,7 +7021,7 @@ var attachCommand = new import_commander36.Command("attach").description("\uBCFC
|
|
|
6221
7021
|
ids: [att.id]
|
|
6222
7022
|
});
|
|
6223
7023
|
});
|
|
6224
|
-
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) => {
|
|
6225
7025
|
const opts = cmd.optsWithGlobals();
|
|
6226
7026
|
const { client } = await resolveInstanceClient(opts);
|
|
6227
7027
|
startSpinner("\uBCFC\uB968 \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -6237,15 +7037,15 @@ var detachCommand = new import_commander36.Command("detach").description("\uBCFC
|
|
|
6237
7037
|
`)
|
|
6238
7038
|
);
|
|
6239
7039
|
});
|
|
6240
|
-
var volumeCommand = new
|
|
7040
|
+
var volumeCommand = new import_commander40.Command("volume").description(
|
|
6241
7041
|
"\uC778\uC2A4\uD134\uC2A4 \uBCFC\uB968 \uC5F0\uACB0/\uD574\uC81C"
|
|
6242
7042
|
);
|
|
6243
7043
|
volumeCommand.addCommand(attachCommand);
|
|
6244
7044
|
volumeCommand.addCommand(detachCommand);
|
|
6245
7045
|
|
|
6246
7046
|
// src/commands/instance/volumes.ts
|
|
6247
|
-
var
|
|
6248
|
-
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) => {
|
|
6249
7049
|
const opts = cmd.optsWithGlobals();
|
|
6250
7050
|
const { client } = await resolveInstanceClient(opts);
|
|
6251
7051
|
startSpinner("\uBCFC\uB968 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -6265,11 +7065,91 @@ var volumesCommand = new import_commander37.Command("volumes").description("\uC7
|
|
|
6265
7065
|
});
|
|
6266
7066
|
});
|
|
6267
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
|
+
|
|
6268
7148
|
// src/commands/ncr/list.ts
|
|
6269
|
-
var
|
|
7149
|
+
var import_commander43 = require("commander");
|
|
6270
7150
|
|
|
6271
7151
|
// src/services/ncr/harbor-client.ts
|
|
6272
|
-
var
|
|
7152
|
+
var import_ky13 = __toESM(require("ky"));
|
|
6273
7153
|
var PAGE_SIZE = 100;
|
|
6274
7154
|
var MAX_PAGES = 1e3;
|
|
6275
7155
|
var HarborClient = class {
|
|
@@ -6298,7 +7178,7 @@ var HarborClient = class {
|
|
|
6298
7178
|
try {
|
|
6299
7179
|
for (; ; ) {
|
|
6300
7180
|
const url = `https://${this.host}${path5}?page=${page}&page_size=${PAGE_SIZE}`;
|
|
6301
|
-
const res = await
|
|
7181
|
+
const res = await import_ky13.default.get(url, {
|
|
6302
7182
|
headers: this.basicAuthHeaders(),
|
|
6303
7183
|
retry: 0,
|
|
6304
7184
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -6355,8 +7235,9 @@ var HarborClient = class {
|
|
|
6355
7235
|
async function createNcrClient(opts) {
|
|
6356
7236
|
const profileName = await resolveProfileName(opts.profile);
|
|
6357
7237
|
const uak = await getUserAccessKey(profileName);
|
|
7238
|
+
const environment = await getProfileEnvironment(profileName);
|
|
6358
7239
|
const region = opts.region ?? "kr1";
|
|
6359
|
-
return { client: new NcrClient(uak.id, uak.secret, region), profileName };
|
|
7240
|
+
return { client: new NcrClient(uak.id, uak.secret, region, environment), profileName };
|
|
6360
7241
|
}
|
|
6361
7242
|
async function resolveAppKey(profileName) {
|
|
6362
7243
|
return resolveServiceAppKey(
|
|
@@ -6393,7 +7274,7 @@ function parseHarborHost(uri) {
|
|
|
6393
7274
|
}
|
|
6394
7275
|
|
|
6395
7276
|
// src/commands/ncr/list.ts
|
|
6396
|
-
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) => {
|
|
6397
7278
|
const opts = cmd.optsWithGlobals();
|
|
6398
7279
|
const { client, profileName } = await createNcrClient(opts);
|
|
6399
7280
|
const appKey = await resolveAppKey(profileName);
|
|
@@ -6419,8 +7300,8 @@ var listCommand5 = new import_commander38.Command("list").description("NCR \uB80
|
|
|
6419
7300
|
});
|
|
6420
7301
|
|
|
6421
7302
|
// src/commands/ncr/get.ts
|
|
6422
|
-
var
|
|
6423
|
-
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) => {
|
|
6424
7305
|
const opts = cmd.optsWithGlobals();
|
|
6425
7306
|
if (!registry.trim()) {
|
|
6426
7307
|
throw new NhnCloudCliError(
|
|
@@ -6448,8 +7329,8 @@ var getCommand3 = new import_commander39.Command("get").description("\uB2E8\uC77
|
|
|
6448
7329
|
});
|
|
6449
7330
|
|
|
6450
7331
|
// src/commands/ncr/images.ts
|
|
6451
|
-
var
|
|
6452
|
-
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) => {
|
|
6453
7334
|
const opts = cmd.optsWithGlobals();
|
|
6454
7335
|
if (!registry.trim()) {
|
|
6455
7336
|
throw new NhnCloudCliError(
|
|
@@ -6483,8 +7364,8 @@ var imagesCommand2 = new import_commander40.Command("images").description("\uB80
|
|
|
6483
7364
|
});
|
|
6484
7365
|
|
|
6485
7366
|
// src/commands/ncr/tags.ts
|
|
6486
|
-
var
|
|
6487
|
-
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) => {
|
|
6488
7369
|
const opts = cmd.optsWithGlobals();
|
|
6489
7370
|
if (!registry.trim()) {
|
|
6490
7371
|
throw new NhnCloudCliError(
|
|
@@ -6525,7 +7406,7 @@ var tagsCommand = new import_commander41.Command("tags").description("\uD2B9\uC8
|
|
|
6525
7406
|
});
|
|
6526
7407
|
|
|
6527
7408
|
// src/commands/commands.ts
|
|
6528
|
-
var
|
|
7409
|
+
var import_commander47 = require("commander");
|
|
6529
7410
|
function commandPath(command) {
|
|
6530
7411
|
const names = [];
|
|
6531
7412
|
let current2 = command;
|
|
@@ -6563,7 +7444,7 @@ function collectCommandCatalog(program2) {
|
|
|
6563
7444
|
return { commands };
|
|
6564
7445
|
}
|
|
6565
7446
|
function createCommandsCommand(program2) {
|
|
6566
|
-
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) => {
|
|
6567
7448
|
const opts = cmd.optsWithGlobals();
|
|
6568
7449
|
const catalog = collectCommandCatalog(program2);
|
|
6569
7450
|
output(opts, {
|
|
@@ -6580,13 +7461,13 @@ function createCommandsCommand(program2) {
|
|
|
6580
7461
|
}
|
|
6581
7462
|
|
|
6582
7463
|
// src/commands/nks/supports.ts
|
|
6583
|
-
var
|
|
7464
|
+
var import_commander48 = require("commander");
|
|
6584
7465
|
|
|
6585
7466
|
// src/commands/nks/helpers.ts
|
|
6586
7467
|
var import_promises6 = require("fs/promises");
|
|
6587
7468
|
|
|
6588
7469
|
// src/services/nks/client.ts
|
|
6589
|
-
var
|
|
7470
|
+
var import_ky14 = __toESM(require("ky"));
|
|
6590
7471
|
|
|
6591
7472
|
// src/services/nks/types.ts
|
|
6592
7473
|
function isNksClusterSummary(val) {
|
|
@@ -6693,7 +7574,7 @@ var NksClient = class {
|
|
|
6693
7574
|
async supports() {
|
|
6694
7575
|
const url = `${this.nksEndpoint}/supports`;
|
|
6695
7576
|
try {
|
|
6696
|
-
const raw = await
|
|
7577
|
+
const raw = await import_ky14.default.get(url, {
|
|
6697
7578
|
headers: this.authHeaders(),
|
|
6698
7579
|
retry: 0,
|
|
6699
7580
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -6713,7 +7594,7 @@ var NksClient = class {
|
|
|
6713
7594
|
async listClusters() {
|
|
6714
7595
|
const url = `${this.nksEndpoint}/clusters`;
|
|
6715
7596
|
try {
|
|
6716
|
-
const raw = await
|
|
7597
|
+
const raw = await import_ky14.default.get(url, {
|
|
6717
7598
|
headers: this.authHeaders(),
|
|
6718
7599
|
retry: 0,
|
|
6719
7600
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -7021,7 +7902,7 @@ var NksClient = class {
|
|
|
7021
7902
|
async removeClusterAddon(cluster, addon) {
|
|
7022
7903
|
const url = `${this.nksEndpoint}/clusters/${encodeURIComponent(cluster)}/addons/${encodeURIComponent(addon)}`;
|
|
7023
7904
|
try {
|
|
7024
|
-
const raw = await
|
|
7905
|
+
const raw = await import_ky14.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS }).json();
|
|
7025
7906
|
if (!isNksUuidResponse(raw)) {
|
|
7026
7907
|
throw new NhnCloudCliError(
|
|
7027
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.",
|
|
@@ -7043,7 +7924,7 @@ var NksClient = class {
|
|
|
7043
7924
|
async getJson(path5, searchParams) {
|
|
7044
7925
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7045
7926
|
try {
|
|
7046
|
-
return await
|
|
7927
|
+
return await import_ky14.default.get(url, {
|
|
7047
7928
|
headers: this.authHeaders(),
|
|
7048
7929
|
searchParams,
|
|
7049
7930
|
retry: 0,
|
|
@@ -7064,10 +7945,10 @@ var NksClient = class {
|
|
|
7064
7945
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7065
7946
|
try {
|
|
7066
7947
|
if (method === "delete") {
|
|
7067
|
-
await
|
|
7948
|
+
await import_ky14.default.delete(url, { headers: this.authHeaders(), retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
7068
7949
|
return;
|
|
7069
7950
|
}
|
|
7070
|
-
await
|
|
7951
|
+
await import_ky14.default.post(url, { headers: this.authHeaders(), json: payload, retry: 0, timeout: DEFAULT_TIMEOUT_MS });
|
|
7071
7952
|
} catch (err) {
|
|
7072
7953
|
throw toNhnCloudCliError(err);
|
|
7073
7954
|
}
|
|
@@ -7076,7 +7957,7 @@ var NksClient = class {
|
|
|
7076
7957
|
const url = `${this.nksEndpoint}${path5}`;
|
|
7077
7958
|
try {
|
|
7078
7959
|
const options = { headers: this.authHeaders(), json: payload, retry: 0, timeout: DEFAULT_TIMEOUT_MS };
|
|
7079
|
-
return method === "post" ? await
|
|
7960
|
+
return method === "post" ? await import_ky14.default.post(url, options).json() : await import_ky14.default.patch(url, options).json();
|
|
7080
7961
|
} catch (err) {
|
|
7081
7962
|
throw toNhnCloudCliError(err);
|
|
7082
7963
|
}
|
|
@@ -7153,7 +8034,7 @@ function parseNonNegativeInteger(value, optionName) {
|
|
|
7153
8034
|
}
|
|
7154
8035
|
|
|
7155
8036
|
// src/commands/nks/supports.ts
|
|
7156
|
-
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) => {
|
|
7157
8038
|
const opts = cmd.optsWithGlobals();
|
|
7158
8039
|
const { client } = await resolveNksClient(opts);
|
|
7159
8040
|
startSpinner("NKS \uC9C0\uC6D0 \uC815\uBCF4 \uC870\uD68C \uC911...");
|
|
@@ -7178,9 +8059,9 @@ var supportsCommand = new import_commander43.Command("supports").description("NK
|
|
|
7178
8059
|
|
|
7179
8060
|
// src/commands/nks/cluster.ts
|
|
7180
8061
|
var import_promises7 = require("fs/promises");
|
|
7181
|
-
var
|
|
8062
|
+
var import_commander49 = require("commander");
|
|
7182
8063
|
var import_chalk14 = __toESM(require("chalk"));
|
|
7183
|
-
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) => {
|
|
7184
8065
|
const opts = cmd.optsWithGlobals();
|
|
7185
8066
|
const { client } = await resolveNksClient(opts);
|
|
7186
8067
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7286,7 +8167,7 @@ async function writeKubeconfigFile(path5, contents, force) {
|
|
|
7286
8167
|
throw err;
|
|
7287
8168
|
}
|
|
7288
8169
|
}
|
|
7289
|
-
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) => {
|
|
7290
8171
|
const opts = cmd.optsWithGlobals();
|
|
7291
8172
|
const payload = await readJsonFile(opts.file);
|
|
7292
8173
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7301,7 +8182,7 @@ var createCommand4 = new import_commander44.Command("create").description("NKS \
|
|
|
7301
8182
|
stopSpinner(true);
|
|
7302
8183
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC0DD\uC131");
|
|
7303
8184
|
});
|
|
7304
|
-
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) => {
|
|
7305
8186
|
const opts = cmd.optsWithGlobals();
|
|
7306
8187
|
const ok = await confirmDangerousAction(`NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7307
8188
|
if (!ok) return;
|
|
@@ -7317,7 +8198,7 @@ var deleteCommand3 = new import_commander44.Command("delete").description("NKS \
|
|
|
7317
8198
|
process.stderr.write(import_chalk14.default.green(`\u2713 NKS \uD074\uB7EC\uC2A4\uD130 "${cluster}" \uC0AD\uC81C \uC694\uCCAD \uC644\uB8CC
|
|
7318
8199
|
`));
|
|
7319
8200
|
});
|
|
7320
|
-
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) => {
|
|
7321
8202
|
const opts = cmd.optsWithGlobals();
|
|
7322
8203
|
const nodeCount = parsePositiveInteger(opts.nodeCount, "--node-count");
|
|
7323
8204
|
const nodesToRemove = opts.nodesToRemove?.split(",").map((node) => node.trim()).filter(Boolean);
|
|
@@ -7341,7 +8222,7 @@ var resizeCommand2 = new import_commander44.Command("resize").description("NKS \
|
|
|
7341
8222
|
stopSpinner(true);
|
|
7342
8223
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 resize");
|
|
7343
8224
|
});
|
|
7344
|
-
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) => {
|
|
7345
8226
|
const opts = cmd.optsWithGlobals();
|
|
7346
8227
|
const payload = await readJsonFile(opts.file);
|
|
7347
8228
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7356,7 +8237,7 @@ var setIpAclCommand = new import_commander44.Command("set-ipacl").description("N
|
|
|
7356
8237
|
stopSpinner(true);
|
|
7357
8238
|
uuidOutput(opts, result, "IP ACL \uC124\uC815");
|
|
7358
8239
|
});
|
|
7359
|
-
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) => {
|
|
7360
8241
|
const opts = cmd.optsWithGlobals();
|
|
7361
8242
|
const term = parsePositiveInteger(opts.termOfValidity, "--term-of-validity");
|
|
7362
8243
|
if (term < 1 || term > 5) {
|
|
@@ -7374,7 +8255,7 @@ var renewCertificateCommand = new import_commander44.Command("renew-certificate"
|
|
|
7374
8255
|
stopSpinner(true);
|
|
7375
8256
|
uuidOutput(opts, result, "\uC778\uC99D\uC11C \uAC31\uC2E0");
|
|
7376
8257
|
});
|
|
7377
|
-
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) => {
|
|
7378
8259
|
const opts = cmd.optsWithGlobals();
|
|
7379
8260
|
const { client } = await resolveNksClient(opts);
|
|
7380
8261
|
startSpinner("NKS \uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7388,7 +8269,7 @@ var updateSgwCommand = new import_commander44.Command("update-sgw").description(
|
|
|
7388
8269
|
stopSpinner(true);
|
|
7389
8270
|
uuidOutput(opts, result, "\uC11C\uBE44\uC2A4 \uAC8C\uC774\uD2B8\uC6E8\uC774 \uBCC0\uACBD");
|
|
7390
8271
|
});
|
|
7391
|
-
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) => {
|
|
7392
8273
|
const opts = cmd.optsWithGlobals();
|
|
7393
8274
|
const controlPlaneLog = await readJsonFile(opts.file);
|
|
7394
8275
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7403,7 +8284,7 @@ var setControlPlaneLogCommand = new import_commander44.Command("set-control-plan
|
|
|
7403
8284
|
stopSpinner(true);
|
|
7404
8285
|
uuidOutput(opts, result, "control plane log \uC124\uC815");
|
|
7405
8286
|
});
|
|
7406
|
-
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) => {
|
|
7407
8288
|
const opts = cmd.optsWithGlobals();
|
|
7408
8289
|
const { client } = await resolveNksClient(opts);
|
|
7409
8290
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC870\uD68C \uC911...");
|
|
@@ -7422,7 +8303,7 @@ var getCommand4 = new import_commander44.Command("get").description("NKS \uD074\
|
|
|
7422
8303
|
ids: [resourceId(result)]
|
|
7423
8304
|
});
|
|
7424
8305
|
});
|
|
7425
|
-
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) => {
|
|
7426
8307
|
const opts = cmd.optsWithGlobals();
|
|
7427
8308
|
const { client } = await resolveNksClient(opts);
|
|
7428
8309
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC791\uC5C5 \uC774\uB825 \uC870\uD68C \uC911...");
|
|
@@ -7443,7 +8324,7 @@ var eventsCommand = new import_commander44.Command("events").description("NKS \u
|
|
|
7443
8324
|
ids: events.map((event) => event.uuid)
|
|
7444
8325
|
});
|
|
7445
8326
|
});
|
|
7446
|
-
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) => {
|
|
7447
8328
|
const opts = cmd.optsWithGlobals();
|
|
7448
8329
|
if (!isUuid(event)) {
|
|
7449
8330
|
throw new NhnCloudCliError(
|
|
@@ -7472,7 +8353,7 @@ var eventCommand = new import_commander44.Command("event").description("NKS \uD0
|
|
|
7472
8353
|
ids: [result.uuid]
|
|
7473
8354
|
});
|
|
7474
8355
|
});
|
|
7475
|
-
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) => {
|
|
7476
8357
|
const opts = cmd.optsWithGlobals();
|
|
7477
8358
|
const { client } = await resolveNksClient(opts);
|
|
7478
8359
|
startSpinner("NKS kubeconfig \uC870\uD68C \uC911...");
|
|
@@ -7492,7 +8373,7 @@ var kubeconfigCommand = new import_commander44.Command("kubeconfig").description
|
|
|
7492
8373
|
}
|
|
7493
8374
|
process.stdout.write(kubeconfig.endsWith("\n") ? kubeconfig : kubeconfig + "\n");
|
|
7494
8375
|
});
|
|
7495
|
-
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) => {
|
|
7496
8377
|
const opts = cmd.optsWithGlobals();
|
|
7497
8378
|
const { client } = await resolveNksClient(opts);
|
|
7498
8379
|
startSpinner("NKS IP ACL \uC870\uD68C \uC911...");
|
|
@@ -7511,7 +8392,7 @@ var ipAclCommand = new import_commander44.Command("ipacl").description("NKS \uD0
|
|
|
7511
8392
|
ids: [result.cluster_uuid]
|
|
7512
8393
|
});
|
|
7513
8394
|
});
|
|
7514
|
-
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) => {
|
|
7515
8396
|
const opts = cmd.optsWithGlobals();
|
|
7516
8397
|
const { client } = await resolveNksClient(opts);
|
|
7517
8398
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7530,7 +8411,7 @@ var clusterAddonListCommand = new import_commander44.Command("list").description
|
|
|
7530
8411
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
7531
8412
|
});
|
|
7532
8413
|
});
|
|
7533
|
-
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) => {
|
|
7534
8415
|
const opts = cmd.optsWithGlobals();
|
|
7535
8416
|
const { client } = await resolveNksClient(opts);
|
|
7536
8417
|
startSpinner("NKS \uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -7558,7 +8439,7 @@ function parseResolveConflicts(value) {
|
|
|
7558
8439
|
EXIT_PARAM_ERROR
|
|
7559
8440
|
);
|
|
7560
8441
|
}
|
|
7561
|
-
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) => {
|
|
7562
8443
|
const opts = cmd.optsWithGlobals();
|
|
7563
8444
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7564
8445
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7577,7 +8458,7 @@ var clusterAddonInstallCommand = new import_commander44.Command("install").descr
|
|
|
7577
8458
|
stopSpinner(true);
|
|
7578
8459
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC124\uCE58");
|
|
7579
8460
|
});
|
|
7580
|
-
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) => {
|
|
7581
8462
|
const opts = cmd.optsWithGlobals();
|
|
7582
8463
|
const resolveConflicts = parseResolveConflicts(opts.resolveConflicts);
|
|
7583
8464
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7595,7 +8476,7 @@ var clusterAddonUpdateCommand = new import_commander44.Command("update").descrip
|
|
|
7595
8476
|
stopSpinner(true);
|
|
7596
8477
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC5C5\uB370\uC774\uD2B8");
|
|
7597
8478
|
});
|
|
7598
|
-
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) => {
|
|
7599
8480
|
const opts = cmd.optsWithGlobals();
|
|
7600
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);
|
|
7601
8482
|
if (!ok) return;
|
|
@@ -7611,11 +8492,11 @@ var clusterAddonRemoveCommand = new import_commander44.Command("remove").descrip
|
|
|
7611
8492
|
stopSpinner(true);
|
|
7612
8493
|
uuidOutput(opts, result, "\uD074\uB7EC\uC2A4\uD130 \uC560\uB4DC\uC628 \uC81C\uAC70");
|
|
7613
8494
|
});
|
|
7614
|
-
var clusterAddonCommand = new
|
|
7615
|
-
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);
|
|
7616
8497
|
|
|
7617
8498
|
// src/commands/nks/nodegroup.ts
|
|
7618
|
-
var
|
|
8499
|
+
var import_commander50 = require("commander");
|
|
7619
8500
|
var import_chalk15 = __toESM(require("chalk"));
|
|
7620
8501
|
function nodeGroupRow(nodegroup) {
|
|
7621
8502
|
return [
|
|
@@ -7669,7 +8550,7 @@ async function confirmDangerousAction2(message, yes) {
|
|
|
7669
8550
|
if (!ok) process.stderr.write(import_chalk15.default.yellow("\uC791\uC5C5\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n"));
|
|
7670
8551
|
return ok;
|
|
7671
8552
|
}
|
|
7672
|
-
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) => {
|
|
7673
8554
|
const opts = cmd.optsWithGlobals();
|
|
7674
8555
|
const { client } = await resolveNksClient(opts);
|
|
7675
8556
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7688,7 +8569,7 @@ var listCommand7 = new import_commander45.Command("list").description("NKS \uB17
|
|
|
7688
8569
|
ids: nodegroups.map((nodegroup) => nodegroup.uuid)
|
|
7689
8570
|
});
|
|
7690
8571
|
});
|
|
7691
|
-
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) => {
|
|
7692
8573
|
const opts = cmd.optsWithGlobals();
|
|
7693
8574
|
const { client } = await resolveNksClient(opts);
|
|
7694
8575
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 \uC870\uD68C \uC911...");
|
|
@@ -7707,7 +8588,7 @@ var getCommand5 = new import_commander45.Command("get").description("NKS \uB178\
|
|
|
7707
8588
|
ids: [result.uuid]
|
|
7708
8589
|
});
|
|
7709
8590
|
});
|
|
7710
|
-
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) => {
|
|
7711
8592
|
const opts = cmd.optsWithGlobals();
|
|
7712
8593
|
const payload = await readJsonFile(opts.file);
|
|
7713
8594
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7722,7 +8603,7 @@ var createCommand5 = new import_commander45.Command("create").description("NKS \
|
|
|
7722
8603
|
stopSpinner(true);
|
|
7723
8604
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 \uC0DD\uC131");
|
|
7724
8605
|
});
|
|
7725
|
-
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) => {
|
|
7726
8607
|
const opts = cmd.optsWithGlobals();
|
|
7727
8608
|
const ok = await confirmDangerousAction2(`NKS \uB178\uB4DC \uADF8\uB8F9 "${nodegroup}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
7728
8609
|
if (!ok) return;
|
|
@@ -7739,7 +8620,7 @@ var deleteCommand4 = new import_commander45.Command("delete").description("NKS \
|
|
|
7739
8620
|
`));
|
|
7740
8621
|
});
|
|
7741
8622
|
function nodeActionCommand(name) {
|
|
7742
|
-
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) => {
|
|
7743
8624
|
const opts = cmd.optsWithGlobals();
|
|
7744
8625
|
const nodes = parseCsv(opts.nodes, "--nodes");
|
|
7745
8626
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7755,7 +8636,7 @@ function nodeActionCommand(name) {
|
|
|
7755
8636
|
uuidOutput2(opts, result, `\uB178\uB4DC ${name === "stop-node" ? "\uC911\uC9C0" : "\uC2DC\uC791"}`);
|
|
7756
8637
|
});
|
|
7757
8638
|
}
|
|
7758
|
-
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) => {
|
|
7759
8640
|
const opts = cmd.optsWithGlobals();
|
|
7760
8641
|
const { client } = await resolveNksClient(opts);
|
|
7761
8642
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 autoscale \uC870\uD68C \uC911...");
|
|
@@ -7774,7 +8655,7 @@ var autoscaleCommand = new import_commander45.Command("autoscale").description("
|
|
|
7774
8655
|
ids: []
|
|
7775
8656
|
});
|
|
7776
8657
|
});
|
|
7777
|
-
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) => {
|
|
7778
8659
|
const opts = cmd.optsWithGlobals();
|
|
7779
8660
|
const payload = await readJsonFile(opts.file);
|
|
7780
8661
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7789,7 +8670,7 @@ var setAutoscaleCommand = new import_commander45.Command("set-autoscale").descri
|
|
|
7789
8670
|
stopSpinner(true);
|
|
7790
8671
|
uuidOutput2(opts, result, "autoscale \uBCC0\uACBD");
|
|
7791
8672
|
});
|
|
7792
|
-
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) => {
|
|
7793
8674
|
const opts = cmd.optsWithGlobals();
|
|
7794
8675
|
const payload = await readJsonFile(opts.file);
|
|
7795
8676
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7804,7 +8685,7 @@ var setMetricAutoscaleCommand = new import_commander45.Command("set-metric-autos
|
|
|
7804
8685
|
stopSpinner(true);
|
|
7805
8686
|
uuidOutput2(opts, result, "metric autoscale \uBCC0\uACBD");
|
|
7806
8687
|
});
|
|
7807
|
-
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) => {
|
|
7808
8689
|
const opts = cmd.optsWithGlobals();
|
|
7809
8690
|
const { client } = await resolveNksClient(opts);
|
|
7810
8691
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 upgrade \uC694\uCCAD \uC911...");
|
|
@@ -7822,7 +8703,7 @@ var upgradeCommand = new import_commander45.Command("upgrade").description("NKS
|
|
|
7822
8703
|
stopSpinner(true);
|
|
7823
8704
|
uuidOutput2(opts, result, "\uB178\uB4DC \uADF8\uB8F9 upgrade");
|
|
7824
8705
|
});
|
|
7825
|
-
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) => {
|
|
7826
8707
|
const opts = cmd.optsWithGlobals();
|
|
7827
8708
|
const contents = await readTextFile(opts.file);
|
|
7828
8709
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7837,7 +8718,7 @@ var setUserscriptCommand = new import_commander45.Command("set-userscript").desc
|
|
|
7837
8718
|
stopSpinner(true);
|
|
7838
8719
|
uuidOutput2(opts, result, "user script \uBCC0\uACBD");
|
|
7839
8720
|
});
|
|
7840
|
-
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) => {
|
|
7841
8722
|
const opts = cmd.optsWithGlobals();
|
|
7842
8723
|
const { client } = await resolveNksClient(opts);
|
|
7843
8724
|
startSpinner("NKS \uB178\uB4DC \uADF8\uB8F9 flavor \uBCC0\uACBD \uC694\uCCAD \uC911...");
|
|
@@ -7856,7 +8737,7 @@ var updateFlavorCommand = new import_commander45.Command("update-flavor").descri
|
|
|
7856
8737
|
uuidOutput2(opts, result, "flavor \uBCC0\uACBD");
|
|
7857
8738
|
});
|
|
7858
8739
|
function patchPayloadCommand(name) {
|
|
7859
|
-
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) => {
|
|
7860
8741
|
const opts = cmd.optsWithGlobals();
|
|
7861
8742
|
const payload = await readJsonFile(opts.file);
|
|
7862
8743
|
const { client } = await resolveNksClient(opts);
|
|
@@ -7872,10 +8753,10 @@ function patchPayloadCommand(name) {
|
|
|
7872
8753
|
uuidOutput2(opts, result, name);
|
|
7873
8754
|
});
|
|
7874
8755
|
}
|
|
7875
|
-
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"));
|
|
7876
8757
|
|
|
7877
8758
|
// src/commands/nks/addon.ts
|
|
7878
|
-
var
|
|
8759
|
+
var import_commander51 = require("commander");
|
|
7879
8760
|
function addonTypeRow(addonType) {
|
|
7880
8761
|
return [
|
|
7881
8762
|
addonType.uuid ?? addonType.id ?? addonType.name,
|
|
@@ -7891,7 +8772,7 @@ function addonRow2(addon) {
|
|
|
7891
8772
|
addon.status ?? ""
|
|
7892
8773
|
];
|
|
7893
8774
|
}
|
|
7894
|
-
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) => {
|
|
7895
8776
|
const opts = cmd.optsWithGlobals();
|
|
7896
8777
|
const { client } = await resolveNksClient(opts);
|
|
7897
8778
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7910,7 +8791,7 @@ var addonTypeListCommand = new import_commander46.Command("list").description("N
|
|
|
7910
8791
|
ids: addonTypes.map((addonType) => addonType.uuid ?? addonType.id ?? addonType.name)
|
|
7911
8792
|
});
|
|
7912
8793
|
});
|
|
7913
|
-
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) => {
|
|
7914
8795
|
const opts = cmd.optsWithGlobals();
|
|
7915
8796
|
const { client } = await resolveNksClient(opts);
|
|
7916
8797
|
startSpinner("NKS \uC560\uB4DC\uC628 \uD0C0\uC785 \uC870\uD68C \uC911...");
|
|
@@ -7929,8 +8810,8 @@ var addonTypeGetCommand = new import_commander46.Command("get").description("NKS
|
|
|
7929
8810
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
7930
8811
|
});
|
|
7931
8812
|
});
|
|
7932
|
-
var addonTypeCommand = new
|
|
7933
|
-
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) => {
|
|
7934
8815
|
const opts = cmd.optsWithGlobals();
|
|
7935
8816
|
const { client } = await resolveNksClient(opts);
|
|
7936
8817
|
startSpinner("NKS \uC560\uB4DC\uC628 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -7953,7 +8834,7 @@ var addonListCommand = new import_commander46.Command("list").description("NKS \
|
|
|
7953
8834
|
ids: addons.map((addon) => addon.uuid ?? addon.id ?? addon.name)
|
|
7954
8835
|
});
|
|
7955
8836
|
});
|
|
7956
|
-
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) => {
|
|
7957
8838
|
const opts = cmd.optsWithGlobals();
|
|
7958
8839
|
const { client } = await resolveNksClient(opts);
|
|
7959
8840
|
startSpinner("NKS \uC560\uB4DC\uC628 \uC870\uD68C \uC911...");
|
|
@@ -7972,10 +8853,10 @@ var addonGetCommand = new import_commander46.Command("get").description("NKS \uC
|
|
|
7972
8853
|
ids: [result.uuid ?? result.id ?? result.name]
|
|
7973
8854
|
});
|
|
7974
8855
|
});
|
|
7975
|
-
var addonCommand = new
|
|
8856
|
+
var addonCommand = new import_commander51.Command("addon").description("NKS \uC560\uB4DC\uC628 \uAD00\uB828 \uBA85\uB839").addCommand(addonListCommand).addCommand(addonGetCommand);
|
|
7976
8857
|
|
|
7977
8858
|
// src/commands/ncs/template.ts
|
|
7978
|
-
var
|
|
8859
|
+
var import_commander52 = require("commander");
|
|
7979
8860
|
var import_chalk16 = __toESM(require("chalk"));
|
|
7980
8861
|
|
|
7981
8862
|
// src/commands/ncs/helpers.ts
|
|
@@ -8090,6 +8971,7 @@ async function resolveNcsAppKey(profileName) {
|
|
|
8090
8971
|
}
|
|
8091
8972
|
async function resolveNcsClient(opts) {
|
|
8092
8973
|
const profileName = await resolveProfileName(opts.profile);
|
|
8974
|
+
await requireRealEnvironment(profileName, "NCS");
|
|
8093
8975
|
const uak = await getUserAccessKey(profileName);
|
|
8094
8976
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
8095
8977
|
const appKey = await resolveNcsAppKey(profileName);
|
|
@@ -8148,7 +9030,7 @@ async function confirmDestructive(message, yes) {
|
|
|
8148
9030
|
}
|
|
8149
9031
|
|
|
8150
9032
|
// src/commands/ncs/template.ts
|
|
8151
|
-
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) => {
|
|
8152
9034
|
const opts = cmd.optsWithGlobals();
|
|
8153
9035
|
const { client } = await resolveNcsClient(opts);
|
|
8154
9036
|
startSpinner("NCS \uC124\uACC4\uB3C4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8179,7 +9061,7 @@ var listCommand8 = new import_commander47.Command("list").description("NCS \uC12
|
|
|
8179
9061
|
ids: templates.map((t) => t.id)
|
|
8180
9062
|
});
|
|
8181
9063
|
});
|
|
8182
|
-
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) => {
|
|
8183
9065
|
const opts = cmd.optsWithGlobals();
|
|
8184
9066
|
requireNonEmpty(id, "id");
|
|
8185
9067
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8207,7 +9089,7 @@ var getCommand6 = new import_commander47.Command("get").description("NCS \uC124\
|
|
|
8207
9089
|
ids: [template.id]
|
|
8208
9090
|
});
|
|
8209
9091
|
});
|
|
8210
|
-
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) => {
|
|
8211
9093
|
const opts = cmd.optsWithGlobals();
|
|
8212
9094
|
const payload = readJsonPayload(opts.file);
|
|
8213
9095
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8235,7 +9117,7 @@ var createCommand6 = new import_commander47.Command("create").description("NCS \
|
|
|
8235
9117
|
ids: [template.id]
|
|
8236
9118
|
});
|
|
8237
9119
|
});
|
|
8238
|
-
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) => {
|
|
8239
9121
|
const opts = cmd.optsWithGlobals();
|
|
8240
9122
|
requireNonEmpty(id, "id");
|
|
8241
9123
|
const ok = await confirmDestructive(`NCS \uC124\uACC4\uB3C4 "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
@@ -8255,7 +9137,7 @@ var deleteCommand5 = new import_commander47.Command("delete").description("NCS \
|
|
|
8255
9137
|
process.stderr.write(import_chalk16.default.green(`\u2713 NCS \uC124\uACC4\uB3C4 "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8256
9138
|
`));
|
|
8257
9139
|
});
|
|
8258
|
-
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) => {
|
|
8259
9141
|
const opts = cmd.optsWithGlobals();
|
|
8260
9142
|
requireNonEmpty(id, "id");
|
|
8261
9143
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8288,7 +9170,7 @@ var versionListCommand = new import_commander47.Command("list").description("NCS
|
|
|
8288
9170
|
ids: versions.map((v) => v.id)
|
|
8289
9171
|
});
|
|
8290
9172
|
});
|
|
8291
|
-
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) => {
|
|
8292
9174
|
const opts = cmd.optsWithGlobals();
|
|
8293
9175
|
requireNonEmpty(id, "id");
|
|
8294
9176
|
requireNonEmpty(version, "version");
|
|
@@ -8309,7 +9191,7 @@ var versionGetCommand = new import_commander47.Command("get").description("NCS \
|
|
|
8309
9191
|
ids: [detail.id]
|
|
8310
9192
|
});
|
|
8311
9193
|
});
|
|
8312
|
-
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) => {
|
|
8313
9195
|
const opts = cmd.optsWithGlobals();
|
|
8314
9196
|
requireNonEmpty(id, "id");
|
|
8315
9197
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8330,7 +9212,7 @@ var versionCreateCommand = new import_commander47.Command("create").description(
|
|
|
8330
9212
|
ids: [version.id]
|
|
8331
9213
|
});
|
|
8332
9214
|
});
|
|
8333
|
-
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) => {
|
|
8334
9216
|
const opts = cmd.optsWithGlobals();
|
|
8335
9217
|
requireNonEmpty(id, "id");
|
|
8336
9218
|
requireNonEmpty(version, "version");
|
|
@@ -8356,11 +9238,11 @@ var versionDeleteCommand = new import_commander47.Command("delete").description(
|
|
|
8356
9238
|
`)
|
|
8357
9239
|
);
|
|
8358
9240
|
});
|
|
8359
|
-
var versionCommand = new
|
|
8360
|
-
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);
|
|
8361
9243
|
|
|
8362
9244
|
// src/commands/ncs/workload.ts
|
|
8363
|
-
var
|
|
9245
|
+
var import_commander53 = require("commander");
|
|
8364
9246
|
var import_chalk17 = __toESM(require("chalk"));
|
|
8365
9247
|
function workloadRows(w) {
|
|
8366
9248
|
return [
|
|
@@ -8375,7 +9257,7 @@ function workloadRows(w) {
|
|
|
8375
9257
|
];
|
|
8376
9258
|
}
|
|
8377
9259
|
var WORKLOAD_HEADERS = ["id", "name", "type", "status", "desired", "available"];
|
|
8378
|
-
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) => {
|
|
8379
9261
|
const opts = cmd.optsWithGlobals();
|
|
8380
9262
|
const { client } = await resolveNcsClient(opts);
|
|
8381
9263
|
startSpinner("NCS workload \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -8408,7 +9290,7 @@ var listCommand9 = new import_commander48.Command("list").description("NCS workl
|
|
|
8408
9290
|
ids: workloads.map((w) => w.id)
|
|
8409
9291
|
});
|
|
8410
9292
|
});
|
|
8411
|
-
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) => {
|
|
8412
9294
|
const opts = cmd.optsWithGlobals();
|
|
8413
9295
|
requireNonEmpty(id, "id");
|
|
8414
9296
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8438,7 +9320,7 @@ var getCommand7 = new import_commander48.Command("get").description("NCS workloa
|
|
|
8438
9320
|
ids: [workload.id]
|
|
8439
9321
|
});
|
|
8440
9322
|
});
|
|
8441
|
-
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(
|
|
8442
9324
|
"--from <time>",
|
|
8443
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"
|
|
8444
9326
|
).option(
|
|
@@ -8483,7 +9365,7 @@ var logsCommand = new import_commander48.Command("logs").description("NCS worklo
|
|
|
8483
9365
|
ids: []
|
|
8484
9366
|
});
|
|
8485
9367
|
});
|
|
8486
|
-
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(
|
|
8487
9369
|
"--from <time>",
|
|
8488
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"
|
|
8489
9371
|
).option(
|
|
@@ -8525,7 +9407,7 @@ var eventsCommand2 = new import_commander48.Command("events").description("NCS w
|
|
|
8525
9407
|
ids: []
|
|
8526
9408
|
});
|
|
8527
9409
|
});
|
|
8528
|
-
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) => {
|
|
8529
9411
|
const opts = cmd.optsWithGlobals();
|
|
8530
9412
|
requireNonEmpty(id, "id");
|
|
8531
9413
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8554,7 +9436,7 @@ var historyGetCommand = new import_commander48.Command("get").description("NCS w
|
|
|
8554
9436
|
ids: [String(detail.id)]
|
|
8555
9437
|
});
|
|
8556
9438
|
});
|
|
8557
|
-
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) => {
|
|
8558
9440
|
const opts = cmd.optsWithGlobals();
|
|
8559
9441
|
requireNonEmpty(id, "id");
|
|
8560
9442
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8587,7 +9469,7 @@ var historyCommand = new import_commander48.Command("history").description("NCS
|
|
|
8587
9469
|
ids: history.map((h) => String(h.id))
|
|
8588
9470
|
});
|
|
8589
9471
|
}).addCommand(historyGetCommand);
|
|
8590
|
-
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) => {
|
|
8591
9473
|
const opts = cmd.optsWithGlobals();
|
|
8592
9474
|
requireNonEmpty(id, "id");
|
|
8593
9475
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8608,7 +9490,7 @@ var scheduleHistoryCommand = new import_commander48.Command("schedule-history").
|
|
|
8608
9490
|
ids: scheduleHistory.map((s) => s.id)
|
|
8609
9491
|
});
|
|
8610
9492
|
});
|
|
8611
|
-
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) => {
|
|
8612
9494
|
const opts = cmd.optsWithGlobals();
|
|
8613
9495
|
const payload = readJsonPayload(opts.file);
|
|
8614
9496
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
@@ -8639,7 +9521,7 @@ var createCommand7 = new import_commander48.Command("create").description("NCS w
|
|
|
8639
9521
|
ids: [workload.id]
|
|
8640
9522
|
});
|
|
8641
9523
|
});
|
|
8642
|
-
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) => {
|
|
8643
9525
|
const opts = cmd.optsWithGlobals();
|
|
8644
9526
|
requireNonEmpty(id, "id");
|
|
8645
9527
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8660,7 +9542,7 @@ var updateCommand = new import_commander48.Command("update").description("NCS wo
|
|
|
8660
9542
|
ids: [workload.id]
|
|
8661
9543
|
});
|
|
8662
9544
|
});
|
|
8663
|
-
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) => {
|
|
8664
9546
|
const opts = cmd.optsWithGlobals();
|
|
8665
9547
|
requireNonEmpty(id, "id");
|
|
8666
9548
|
const payload = readJsonPayload(opts.file);
|
|
@@ -8681,7 +9563,7 @@ var patchCommand = new import_commander48.Command("patch").description("NCS work
|
|
|
8681
9563
|
ids: [workload.id]
|
|
8682
9564
|
});
|
|
8683
9565
|
});
|
|
8684
|
-
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) => {
|
|
8685
9567
|
const opts = cmd.optsWithGlobals();
|
|
8686
9568
|
requireNonEmpty(id, "id");
|
|
8687
9569
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8696,7 +9578,7 @@ var pauseCommand = new import_commander48.Command("pause").description("NCS work
|
|
|
8696
9578
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC77C\uC2DC\uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8697
9579
|
`));
|
|
8698
9580
|
});
|
|
8699
|
-
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) => {
|
|
8700
9582
|
const opts = cmd.optsWithGlobals();
|
|
8701
9583
|
requireNonEmpty(id, "id");
|
|
8702
9584
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8711,7 +9593,7 @@ var resumeCommand = new import_commander48.Command("resume").description("NCS wo
|
|
|
8711
9593
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC7AC\uAC1C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8712
9594
|
`));
|
|
8713
9595
|
});
|
|
8714
|
-
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) => {
|
|
8715
9597
|
const opts = cmd.optsWithGlobals();
|
|
8716
9598
|
requireNonEmpty(id, "id");
|
|
8717
9599
|
if (!opts.task || !opts.task.trim()) {
|
|
@@ -8734,7 +9616,7 @@ var restartCommand = new import_commander48.Command("restart").description("NCS
|
|
|
8734
9616
|
`)
|
|
8735
9617
|
);
|
|
8736
9618
|
});
|
|
8737
|
-
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) => {
|
|
8738
9620
|
const opts = cmd.optsWithGlobals();
|
|
8739
9621
|
requireNonEmpty(id, "id");
|
|
8740
9622
|
const ok = await confirmDestructive(`NCS workload "${id}" \uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`, opts.yes);
|
|
@@ -8754,10 +9636,10 @@ var deleteCommand6 = new import_commander48.Command("delete").description("NCS w
|
|
|
8754
9636
|
process.stderr.write(import_chalk17.default.green(`\u2713 NCS workload "${id}" \uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
8755
9637
|
`));
|
|
8756
9638
|
});
|
|
8757
|
-
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);
|
|
8758
9640
|
|
|
8759
9641
|
// src/commands/ncs/malware.ts
|
|
8760
|
-
var
|
|
9642
|
+
var import_commander54 = require("commander");
|
|
8761
9643
|
function parseEnabledOption(value) {
|
|
8762
9644
|
if (value === "true") return true;
|
|
8763
9645
|
if (value === "false") return false;
|
|
@@ -8766,7 +9648,7 @@ function parseEnabledOption(value) {
|
|
|
8766
9648
|
EXIT_PARAM_ERROR
|
|
8767
9649
|
);
|
|
8768
9650
|
}
|
|
8769
|
-
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) => {
|
|
8770
9652
|
const opts = cmd.optsWithGlobals();
|
|
8771
9653
|
const { client } = await resolveNcsClient(opts);
|
|
8772
9654
|
startSpinner("NCS \uC545\uC131\uCF54\uB4DC \uAC80\uC0AC \uC124\uC815 \uC870\uD68C \uC911...");
|
|
@@ -8785,7 +9667,7 @@ var configGetCommand = new import_commander49.Command("get").description("NCS \u
|
|
|
8785
9667
|
ids: []
|
|
8786
9668
|
});
|
|
8787
9669
|
});
|
|
8788
|
-
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) => {
|
|
8789
9671
|
const opts = cmd.optsWithGlobals();
|
|
8790
9672
|
const enabled = parseEnabledOption(opts.enabled);
|
|
8791
9673
|
const { client } = await resolveNcsClient(opts);
|
|
@@ -8805,8 +9687,8 @@ var configSetCommand = new import_commander49.Command("set").description("NCS \u
|
|
|
8805
9687
|
ids: []
|
|
8806
9688
|
});
|
|
8807
9689
|
});
|
|
8808
|
-
var configCommand = new
|
|
8809
|
-
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) => {
|
|
8810
9692
|
const opts = cmd.optsWithGlobals();
|
|
8811
9693
|
requireNonEmpty(workloadId, "workloadId");
|
|
8812
9694
|
requireNonEmpty(historyId, "historyId");
|
|
@@ -8837,16 +9719,16 @@ var resultCommand = new import_commander49.Command("result").description("NCS wo
|
|
|
8837
9719
|
ids: []
|
|
8838
9720
|
});
|
|
8839
9721
|
});
|
|
8840
|
-
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);
|
|
8841
9723
|
|
|
8842
9724
|
// src/commands/apigateway/service.ts
|
|
8843
|
-
var
|
|
9725
|
+
var import_commander55 = require("commander");
|
|
8844
9726
|
|
|
8845
9727
|
// src/commands/apigateway/helpers.ts
|
|
8846
9728
|
var import_promises8 = require("fs/promises");
|
|
8847
9729
|
|
|
8848
9730
|
// src/services/apigateway/client.ts
|
|
8849
|
-
var
|
|
9731
|
+
var import_ky15 = __toESM(require("ky"));
|
|
8850
9732
|
|
|
8851
9733
|
// src/services/apigateway/types.ts
|
|
8852
9734
|
function isApiGatewayService(value) {
|
|
@@ -8963,7 +9845,7 @@ var ApiGatewayClient = class {
|
|
|
8963
9845
|
let page = params.page ?? 1;
|
|
8964
9846
|
try {
|
|
8965
9847
|
while (true) {
|
|
8966
|
-
const response = await
|
|
9848
|
+
const response = await import_ky15.default.get(`${this.baseUrl}/services`, {
|
|
8967
9849
|
headers: this.authHeaders(),
|
|
8968
9850
|
searchParams: { page, limit },
|
|
8969
9851
|
retry: 0,
|
|
@@ -9003,7 +9885,7 @@ var ApiGatewayClient = class {
|
|
|
9003
9885
|
/** API Gateway service 한 건을 조회한다. */
|
|
9004
9886
|
async getService(apigwServiceId) {
|
|
9005
9887
|
try {
|
|
9006
|
-
const response = await
|
|
9888
|
+
const response = await import_ky15.default.get(`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}`, {
|
|
9007
9889
|
headers: this.authHeaders(),
|
|
9008
9890
|
retry: 0,
|
|
9009
9891
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -9024,7 +9906,7 @@ var ApiGatewayClient = class {
|
|
|
9024
9906
|
/** paging 없이 API Gateway resource 전체를 한 번에 조회한다. */
|
|
9025
9907
|
async listResources(apigwServiceId) {
|
|
9026
9908
|
try {
|
|
9027
|
-
const response = await
|
|
9909
|
+
const response = await import_ky15.default.get(
|
|
9028
9910
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources`,
|
|
9029
9911
|
{
|
|
9030
9912
|
headers: this.authHeaders(),
|
|
@@ -9048,7 +9930,7 @@ var ApiGatewayClient = class {
|
|
|
9048
9930
|
/** API Gateway resource 경로 플러그인을 upsert한다. */
|
|
9049
9931
|
async setPathPlugins(apigwServiceId, resourceId2, pathPluginList) {
|
|
9050
9932
|
try {
|
|
9051
|
-
const response = await
|
|
9933
|
+
const response = await import_ky15.default.put(
|
|
9052
9934
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resource-paths/${encodeURIComponent(resourceId2)}`,
|
|
9053
9935
|
{
|
|
9054
9936
|
headers: this.authHeaders(),
|
|
@@ -9073,7 +9955,7 @@ var ApiGatewayClient = class {
|
|
|
9073
9955
|
/** API Gateway resource 메서드 플러그인을 upsert한다. */
|
|
9074
9956
|
async setMethodPlugins(apigwServiceId, resourceId2, body) {
|
|
9075
9957
|
try {
|
|
9076
|
-
const response = await
|
|
9958
|
+
const response = await import_ky15.default.put(
|
|
9077
9959
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resource-methods/${encodeURIComponent(resourceId2)}`,
|
|
9078
9960
|
{
|
|
9079
9961
|
headers: this.authHeaders(),
|
|
@@ -9098,7 +9980,7 @@ var ApiGatewayClient = class {
|
|
|
9098
9980
|
/** API Gateway resource 요청 parameter를 조회한다. */
|
|
9099
9981
|
async getResourceParameters(apigwServiceId, resourceId2) {
|
|
9100
9982
|
try {
|
|
9101
|
-
const response = await
|
|
9983
|
+
const response = await import_ky15.default.get(
|
|
9102
9984
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources/${encodeURIComponent(resourceId2)}/parameters`,
|
|
9103
9985
|
{
|
|
9104
9986
|
headers: this.authHeaders(),
|
|
@@ -9128,7 +10010,7 @@ var ApiGatewayClient = class {
|
|
|
9128
10010
|
/** API Gateway resource 응답 정의를 조회한다. */
|
|
9129
10011
|
async getResourceResponses(apigwServiceId, resourceId2) {
|
|
9130
10012
|
try {
|
|
9131
|
-
const response = await
|
|
10013
|
+
const response = await import_ky15.default.get(
|
|
9132
10014
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/resources/${encodeURIComponent(resourceId2)}/responses`,
|
|
9133
10015
|
{
|
|
9134
10016
|
headers: this.authHeaders(),
|
|
@@ -9159,7 +10041,7 @@ var ApiGatewayClient = class {
|
|
|
9159
10041
|
let page = 1;
|
|
9160
10042
|
try {
|
|
9161
10043
|
while (true) {
|
|
9162
|
-
const response = await
|
|
10044
|
+
const response = await import_ky15.default.get(
|
|
9163
10045
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages`,
|
|
9164
10046
|
{
|
|
9165
10047
|
headers: this.authHeaders(),
|
|
@@ -9202,7 +10084,7 @@ var ApiGatewayClient = class {
|
|
|
9202
10084
|
/** API Gateway stage의 backend endpoint와 설명을 수정한다. */
|
|
9203
10085
|
async updateStage(apigwServiceId, stageId, body) {
|
|
9204
10086
|
try {
|
|
9205
|
-
const response = await
|
|
10087
|
+
const response = await import_ky15.default.put(
|
|
9206
10088
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}`,
|
|
9207
10089
|
{
|
|
9208
10090
|
headers: this.authHeaders(),
|
|
@@ -9227,7 +10109,7 @@ var ApiGatewayClient = class {
|
|
|
9227
10109
|
/** 사용자 정의 Swagger 객체를 내부 해석 없이 반환한다. */
|
|
9228
10110
|
async getStageSwagger(apigwServiceId, stageId) {
|
|
9229
10111
|
try {
|
|
9230
|
-
const response = await
|
|
10112
|
+
const response = await import_ky15.default.get(
|
|
9231
10113
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/swagger`,
|
|
9232
10114
|
{
|
|
9233
10115
|
headers: this.authHeaders(),
|
|
@@ -9251,7 +10133,7 @@ var ApiGatewayClient = class {
|
|
|
9251
10133
|
/** paging 없이 배포된 API Gateway stage resource 전체를 한 번에 조회한다. */
|
|
9252
10134
|
async listStageResources(apigwServiceId, stageId) {
|
|
9253
10135
|
try {
|
|
9254
|
-
const response = await
|
|
10136
|
+
const response = await import_ky15.default.get(
|
|
9255
10137
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/resources`,
|
|
9256
10138
|
{
|
|
9257
10139
|
headers: this.authHeaders(),
|
|
@@ -9275,7 +10157,7 @@ var ApiGatewayClient = class {
|
|
|
9275
10157
|
/** API Gateway service resource를 stage에 반영한다. */
|
|
9276
10158
|
async importStageResources(apigwServiceId, stageId) {
|
|
9277
10159
|
try {
|
|
9278
|
-
const response = await
|
|
10160
|
+
const response = await import_ky15.default.put(
|
|
9279
10161
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/resources`,
|
|
9280
10162
|
{
|
|
9281
10163
|
headers: this.authHeaders(),
|
|
@@ -9300,7 +10182,7 @@ var ApiGatewayClient = class {
|
|
|
9300
10182
|
async createDeploy(apigwServiceId, stageId, body) {
|
|
9301
10183
|
const json = body.deployDescription === void 0 ? {} : { deployDescription: body.deployDescription };
|
|
9302
10184
|
try {
|
|
9303
|
-
const response = await
|
|
10185
|
+
const response = await import_ky15.default.post(
|
|
9304
10186
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys`,
|
|
9305
10187
|
{
|
|
9306
10188
|
headers: this.authHeaders(),
|
|
@@ -9318,7 +10200,7 @@ var ApiGatewayClient = class {
|
|
|
9318
10200
|
/** 배포 이력의 설정으로 API Gateway stage를 롤백한다. */
|
|
9319
10201
|
async rollbackDeploy(apigwServiceId, stageId, deployId) {
|
|
9320
10202
|
try {
|
|
9321
|
-
const response = await
|
|
10203
|
+
const response = await import_ky15.default.post(
|
|
9322
10204
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys/${encodeURIComponent(deployId)}/rollback`,
|
|
9323
10205
|
{
|
|
9324
10206
|
headers: this.authHeaders(),
|
|
@@ -9346,7 +10228,7 @@ var ApiGatewayClient = class {
|
|
|
9346
10228
|
let page = 1;
|
|
9347
10229
|
try {
|
|
9348
10230
|
while (true) {
|
|
9349
|
-
const response = await
|
|
10231
|
+
const response = await import_ky15.default.get(
|
|
9350
10232
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys`,
|
|
9351
10233
|
{
|
|
9352
10234
|
headers: this.authHeaders(),
|
|
@@ -9389,7 +10271,7 @@ var ApiGatewayClient = class {
|
|
|
9389
10271
|
/** API Gateway stage 최신 배포 결과를 조회한다. */
|
|
9390
10272
|
async getLatestDeploy(apigwServiceId, stageId) {
|
|
9391
10273
|
try {
|
|
9392
|
-
const response = await
|
|
10274
|
+
const response = await import_ky15.default.get(
|
|
9393
10275
|
`${this.baseUrl}/services/${encodeURIComponent(apigwServiceId)}/stages/${encodeURIComponent(stageId)}/deploys/latest`,
|
|
9394
10276
|
{
|
|
9395
10277
|
headers: this.authHeaders(),
|
|
@@ -9445,7 +10327,7 @@ function fileErrorReason(error) {
|
|
|
9445
10327
|
}
|
|
9446
10328
|
return error instanceof Error ? error.message : String(error);
|
|
9447
10329
|
}
|
|
9448
|
-
function
|
|
10330
|
+
function requireYes2(yes, operation) {
|
|
9449
10331
|
if (!yes) {
|
|
9450
10332
|
throw new NhnCloudCliError(
|
|
9451
10333
|
`${operation}\uC5D0\uB294 --yes \uD50C\uB798\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`,
|
|
@@ -9530,6 +10412,7 @@ async function resolveApiGatewayAppKey(profileName) {
|
|
|
9530
10412
|
}
|
|
9531
10413
|
async function resolveApiGatewayClient(opts) {
|
|
9532
10414
|
const profileName = await resolveProfileName(opts.profile);
|
|
10415
|
+
await requireRealEnvironment(profileName, "API Gateway");
|
|
9533
10416
|
const uak = await getUserAccessKey(profileName);
|
|
9534
10417
|
const accessToken = await getAccessToken(profileName, uak.id, uak.secret);
|
|
9535
10418
|
const appKey = await resolveApiGatewayAppKey(profileName);
|
|
@@ -9540,7 +10423,7 @@ async function resolveApiGatewayClient(opts) {
|
|
|
9540
10423
|
}
|
|
9541
10424
|
|
|
9542
10425
|
// src/commands/apigateway/service.ts
|
|
9543
|
-
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) => {
|
|
9544
10427
|
const opts = command.optsWithGlobals();
|
|
9545
10428
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9546
10429
|
startSpinner("API Gateway service \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -9571,7 +10454,7 @@ var listCommand10 = new import_commander50.Command("list").description("API Gate
|
|
|
9571
10454
|
ids: services.map((service) => sanitizeForTerminal(service.apigwServiceId))
|
|
9572
10455
|
});
|
|
9573
10456
|
});
|
|
9574
|
-
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) => {
|
|
9575
10458
|
const opts = command.optsWithGlobals();
|
|
9576
10459
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
9577
10460
|
const displayServiceId = sanitizeForTerminal(parsedServiceId);
|
|
@@ -9604,10 +10487,10 @@ var getCommand8 = new import_commander50.Command("get").description("API Gateway
|
|
|
9604
10487
|
ids: [sanitizeForTerminal(service.apigwServiceId)]
|
|
9605
10488
|
});
|
|
9606
10489
|
});
|
|
9607
|
-
var serviceCommand = new
|
|
10490
|
+
var serviceCommand = new import_commander55.Command("service").description("API Gateway service \uC870\uD68C \uBA85\uB839").addCommand(listCommand12).addCommand(getCommand10);
|
|
9608
10491
|
|
|
9609
10492
|
// src/commands/apigateway/resource.ts
|
|
9610
|
-
var
|
|
10493
|
+
var import_commander56 = require("commander");
|
|
9611
10494
|
function addApiGatewayOptions(command) {
|
|
9612
10495
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
9613
10496
|
}
|
|
@@ -9688,8 +10571,8 @@ function updatedResourceOutput(opts, resources) {
|
|
|
9688
10571
|
ids: resources.map((resource) => sanitizeForTerminal(resource.resourceId))
|
|
9689
10572
|
});
|
|
9690
10573
|
}
|
|
9691
|
-
var
|
|
9692
|
-
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")
|
|
9693
10576
|
).action(async (serviceId, _opts, command) => {
|
|
9694
10577
|
const opts = command.optsWithGlobals();
|
|
9695
10578
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9718,7 +10601,7 @@ var listCommand11 = addApiGatewayOptions(
|
|
|
9718
10601
|
});
|
|
9719
10602
|
});
|
|
9720
10603
|
var parametersCommand = addApiGatewayOptions(
|
|
9721
|
-
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")
|
|
9722
10605
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9723
10606
|
const opts = command.optsWithGlobals();
|
|
9724
10607
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9747,7 +10630,7 @@ var parametersCommand = addApiGatewayOptions(
|
|
|
9747
10630
|
});
|
|
9748
10631
|
});
|
|
9749
10632
|
var responsesCommand = addApiGatewayOptions(
|
|
9750
|
-
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")
|
|
9751
10634
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9752
10635
|
const opts = command.optsWithGlobals();
|
|
9753
10636
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9773,7 +10656,7 @@ var responsesCommand = addApiGatewayOptions(
|
|
|
9773
10656
|
});
|
|
9774
10657
|
});
|
|
9775
10658
|
var setPathPluginCommand = addApiGatewayOptions(
|
|
9776
|
-
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")
|
|
9777
10660
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9778
10661
|
const opts = command.optsWithGlobals();
|
|
9779
10662
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9789,7 +10672,7 @@ var setPathPluginCommand = addApiGatewayOptions(
|
|
|
9789
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"
|
|
9790
10673
|
);
|
|
9791
10674
|
}
|
|
9792
|
-
if (!opts.dryRun)
|
|
10675
|
+
if (!opts.dryRun) requireYes2(opts.yes, "\uB9AC\uC18C\uC2A4 \uACBD\uB85C \uD50C\uB7EC\uADF8\uC778 \uC124\uC815");
|
|
9793
10676
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9794
10677
|
const displayResourceId = sanitizeForTerminal(parsedResourceId);
|
|
9795
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";
|
|
@@ -9847,13 +10730,13 @@ var setPathPluginCommand = addApiGatewayOptions(
|
|
|
9847
10730
|
updatedResourceOutput(opts, updatedResources);
|
|
9848
10731
|
});
|
|
9849
10732
|
var setMethodPluginCommand = addApiGatewayOptions(
|
|
9850
|
-
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")
|
|
9851
10734
|
).action(async (serviceId, resourceId2, _opts, command) => {
|
|
9852
10735
|
const opts = command.optsWithGlobals();
|
|
9853
10736
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
9854
10737
|
const parsedResourceId = parseRequiredArgument(resourceId2, "resource-id");
|
|
9855
10738
|
const config = parseMethodPluginConfig(await readPluginConfigFile(opts.configFile));
|
|
9856
|
-
if (!opts.dryRun)
|
|
10739
|
+
if (!opts.dryRun) requireYes2(opts.yes, "\uB9AC\uC18C\uC2A4 \uBA54\uC11C\uB4DC \uD50C\uB7EC\uADF8\uC778 \uC124\uC815");
|
|
9857
10740
|
const { client } = await resolveApiGatewayClient(opts);
|
|
9858
10741
|
const displayResourceId = sanitizeForTerminal(parsedResourceId);
|
|
9859
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";
|
|
@@ -9935,19 +10818,19 @@ var setMethodPluginCommand = addApiGatewayOptions(
|
|
|
9935
10818
|
}
|
|
9936
10819
|
updatedResourceOutput(opts, updatedResources);
|
|
9937
10820
|
});
|
|
9938
|
-
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);
|
|
9939
10822
|
|
|
9940
10823
|
// src/commands/apigateway/stage.ts
|
|
9941
10824
|
var import_promises9 = require("fs/promises");
|
|
9942
|
-
var
|
|
10825
|
+
var import_commander58 = require("commander");
|
|
9943
10826
|
|
|
9944
10827
|
// src/commands/apigateway/deploy.ts
|
|
9945
|
-
var
|
|
10828
|
+
var import_commander57 = require("commander");
|
|
9946
10829
|
function addApiGatewayOptions2(command) {
|
|
9947
10830
|
return command.option("--region <region>", "API Gateway region (\uAE30\uBCF8: kr1)", "kr1").option("--profile <name>", "\uC0AC\uC6A9\uD560 profile \uC774\uB984");
|
|
9948
10831
|
}
|
|
9949
|
-
var
|
|
9950
|
-
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")
|
|
9951
10834
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
9952
10835
|
const opts = command.optsWithGlobals();
|
|
9953
10836
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -9976,7 +10859,7 @@ var listCommand12 = addApiGatewayOptions2(
|
|
|
9976
10859
|
});
|
|
9977
10860
|
});
|
|
9978
10861
|
var latestCommand = addApiGatewayOptions2(
|
|
9979
|
-
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")
|
|
9980
10863
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
9981
10864
|
const opts = command.optsWithGlobals();
|
|
9982
10865
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10005,8 +10888,8 @@ var latestCommand = addApiGatewayOptions2(
|
|
|
10005
10888
|
ids: [sanitizeForTerminal(deploy.deployId)]
|
|
10006
10889
|
});
|
|
10007
10890
|
});
|
|
10008
|
-
var
|
|
10009
|
-
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")
|
|
10010
10893
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10011
10894
|
const opts = command.optsWithGlobals();
|
|
10012
10895
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10024,7 +10907,7 @@ var createCommand8 = addApiGatewayOptions2(
|
|
|
10024
10907
|
);
|
|
10025
10908
|
}
|
|
10026
10909
|
const timeoutMs = parsePositiveIntegerOption(opts.timeout ?? "300", "--timeout") * 1e3;
|
|
10027
|
-
|
|
10910
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uBC30\uD3EC");
|
|
10028
10911
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10029
10912
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10030
10913
|
let baselineDeployId = null;
|
|
@@ -10104,13 +10987,13 @@ var createCommand8 = addApiGatewayOptions2(
|
|
|
10104
10987
|
});
|
|
10105
10988
|
});
|
|
10106
10989
|
var rollbackCommand = addApiGatewayOptions2(
|
|
10107
|
-
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")
|
|
10108
10991
|
).action(async (serviceId, stageId, deployId, _opts, command) => {
|
|
10109
10992
|
const opts = command.optsWithGlobals();
|
|
10110
10993
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
10111
10994
|
const parsedStageId = parseRequiredArgument(stageId, "stage-id");
|
|
10112
10995
|
const parsedDeployId = parseRequiredArgument(deployId, "deploy-id");
|
|
10113
|
-
|
|
10996
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uB418\uB3CC\uB9AC\uAE30");
|
|
10114
10997
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10115
10998
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10116
10999
|
startSpinner(`API Gateway stage "${displayStageId}" \uB418\uB3CC\uB9AC\uB294 \uC911...`);
|
|
@@ -10132,7 +11015,7 @@ var rollbackCommand = addApiGatewayOptions2(
|
|
|
10132
11015
|
);
|
|
10133
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");
|
|
10134
11017
|
});
|
|
10135
|
-
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);
|
|
10136
11019
|
|
|
10137
11020
|
// src/commands/apigateway/stage.ts
|
|
10138
11021
|
function addApiGatewayOptions3(command) {
|
|
@@ -10160,8 +11043,8 @@ async function writeStageSwaggerFile(path5, swagger, force) {
|
|
|
10160
11043
|
);
|
|
10161
11044
|
}
|
|
10162
11045
|
}
|
|
10163
|
-
var
|
|
10164
|
-
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")
|
|
10165
11048
|
).action(async (serviceId, _opts, command) => {
|
|
10166
11049
|
const opts = command.optsWithGlobals();
|
|
10167
11050
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10190,7 +11073,7 @@ var listCommand13 = addApiGatewayOptions3(
|
|
|
10190
11073
|
});
|
|
10191
11074
|
});
|
|
10192
11075
|
var swaggerCommand = addApiGatewayOptions3(
|
|
10193
|
-
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")
|
|
10194
11077
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10195
11078
|
const opts = command.optsWithGlobals();
|
|
10196
11079
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10214,7 +11097,7 @@ var swaggerCommand = addApiGatewayOptions3(
|
|
|
10214
11097
|
printJson(swagger);
|
|
10215
11098
|
});
|
|
10216
11099
|
var resourcesCommand = addApiGatewayOptions3(
|
|
10217
|
-
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")
|
|
10218
11101
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10219
11102
|
const opts = command.optsWithGlobals();
|
|
10220
11103
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10243,8 +11126,8 @@ var resourcesCommand = addApiGatewayOptions3(
|
|
|
10243
11126
|
ids: resources.map((resource) => sanitizeForTerminal(resource.stageResourceId))
|
|
10244
11127
|
});
|
|
10245
11128
|
});
|
|
10246
|
-
var
|
|
10247
|
-
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")
|
|
10248
11131
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10249
11132
|
const opts = command.optsWithGlobals();
|
|
10250
11133
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
@@ -10255,7 +11138,7 @@ var updateCommand2 = addApiGatewayOptions3(
|
|
|
10255
11138
|
EXIT_PARAM_ERROR
|
|
10256
11139
|
);
|
|
10257
11140
|
}
|
|
10258
|
-
|
|
11141
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uC218\uC815");
|
|
10259
11142
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10260
11143
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10261
11144
|
startSpinner(`API Gateway stage "${displayStageId}" \uC218\uC815 \uC911...`);
|
|
@@ -10293,12 +11176,12 @@ var updateCommand2 = addApiGatewayOptions3(
|
|
|
10293
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");
|
|
10294
11177
|
});
|
|
10295
11178
|
var importResourcesCommand = addApiGatewayOptions3(
|
|
10296
|
-
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")
|
|
10297
11180
|
).action(async (serviceId, stageId, _opts, command) => {
|
|
10298
11181
|
const opts = command.optsWithGlobals();
|
|
10299
11182
|
const parsedServiceId = parseRequiredArgument(serviceId, "service-id");
|
|
10300
11183
|
const parsedStageId = parseRequiredArgument(stageId, "stage-id");
|
|
10301
|
-
|
|
11184
|
+
requireYes2(opts.yes, "\uC2A4\uD14C\uC774\uC9C0 \uBC18\uC601");
|
|
10302
11185
|
const displayStageId = sanitizeForTerminal(parsedStageId);
|
|
10303
11186
|
const { client } = await resolveApiGatewayClient(opts);
|
|
10304
11187
|
startSpinner(`API Gateway stage "${displayStageId}" \uB9AC\uC18C\uC2A4 \uBC18\uC601 \uC911...`);
|
|
@@ -10315,16 +11198,16 @@ var importResourcesCommand = addApiGatewayOptions3(
|
|
|
10315
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"
|
|
10316
11199
|
);
|
|
10317
11200
|
});
|
|
10318
|
-
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);
|
|
10319
11202
|
|
|
10320
11203
|
// src/commands/loadbalancer/list.ts
|
|
10321
|
-
var
|
|
11204
|
+
var import_commander59 = require("commander");
|
|
10322
11205
|
|
|
10323
11206
|
// src/commands/loadbalancer/helpers.ts
|
|
10324
|
-
var
|
|
11207
|
+
var import_node_net2 = require("net");
|
|
10325
11208
|
|
|
10326
11209
|
// src/services/loadbalancer/client.ts
|
|
10327
|
-
var
|
|
11210
|
+
var import_ky16 = __toESM(require("ky"));
|
|
10328
11211
|
|
|
10329
11212
|
// src/services/loadbalancer/types.ts
|
|
10330
11213
|
function isRecord3(value) {
|
|
@@ -10521,7 +11404,7 @@ var LoadBalancerClient = class {
|
|
|
10521
11404
|
async getJson(path5, searchParams) {
|
|
10522
11405
|
const url = `${this.endpoint}${path5}`;
|
|
10523
11406
|
try {
|
|
10524
|
-
return await
|
|
11407
|
+
return await import_ky16.default.get(url, {
|
|
10525
11408
|
headers: this.authHeaders(),
|
|
10526
11409
|
searchParams,
|
|
10527
11410
|
retry: 0,
|
|
@@ -10534,7 +11417,7 @@ var LoadBalancerClient = class {
|
|
|
10534
11417
|
async postJson(path5, json) {
|
|
10535
11418
|
const url = `${this.endpoint}${path5}`;
|
|
10536
11419
|
try {
|
|
10537
|
-
return await
|
|
11420
|
+
return await import_ky16.default.post(url, {
|
|
10538
11421
|
headers: this.authHeaders(),
|
|
10539
11422
|
json,
|
|
10540
11423
|
retry: 0,
|
|
@@ -10547,7 +11430,7 @@ var LoadBalancerClient = class {
|
|
|
10547
11430
|
async putJson(path5, json) {
|
|
10548
11431
|
const url = `${this.endpoint}${path5}`;
|
|
10549
11432
|
try {
|
|
10550
|
-
return await
|
|
11433
|
+
return await import_ky16.default.put(url, {
|
|
10551
11434
|
headers: this.authHeaders(),
|
|
10552
11435
|
json,
|
|
10553
11436
|
retry: 0,
|
|
@@ -10560,7 +11443,7 @@ var LoadBalancerClient = class {
|
|
|
10560
11443
|
async deleteNoContent(path5) {
|
|
10561
11444
|
const url = `${this.endpoint}${path5}`;
|
|
10562
11445
|
try {
|
|
10563
|
-
await
|
|
11446
|
+
await import_ky16.default.delete(url, {
|
|
10564
11447
|
headers: this.authHeaders(),
|
|
10565
11448
|
retry: 0,
|
|
10566
11449
|
timeout: DEFAULT_TIMEOUT_MS
|
|
@@ -10572,26 +11455,10 @@ var LoadBalancerClient = class {
|
|
|
10572
11455
|
};
|
|
10573
11456
|
|
|
10574
11457
|
// src/commands/loadbalancer/helpers.ts
|
|
10575
|
-
function requireResourceInput(value, label) {
|
|
10576
|
-
const normalized = value.trim();
|
|
10577
|
-
if (!normalized) {
|
|
10578
|
-
throw new NhnCloudCliError(`${label} \uC774\uB984 \uB610\uB294 UUID\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
10579
|
-
}
|
|
10580
|
-
return normalized;
|
|
10581
|
-
}
|
|
10582
11458
|
function optionalTrimmed(value) {
|
|
10583
11459
|
if (value === void 0) return void 0;
|
|
10584
11460
|
return value.trim();
|
|
10585
11461
|
}
|
|
10586
|
-
function requireYes2(yes, operation) {
|
|
10587
|
-
if (!yes) {
|
|
10588
|
-
throw new NhnCloudCliError(
|
|
10589
|
-
`${operation}\uC5D0\uB294 --yes \uD50C\uB798\uADF8\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.`,
|
|
10590
|
-
EXIT_PARAM_ERROR
|
|
10591
|
-
);
|
|
10592
|
-
}
|
|
10593
|
-
return true;
|
|
10594
|
-
}
|
|
10595
11462
|
function parseIpAclAction(value) {
|
|
10596
11463
|
if (value !== "ALLOW" && value !== "DENY") {
|
|
10597
11464
|
throw new NhnCloudCliError(
|
|
@@ -10614,7 +11481,7 @@ function parseIpOrCidr(value) {
|
|
|
10614
11481
|
const normalized = value.trim();
|
|
10615
11482
|
const parts = normalized.split("/");
|
|
10616
11483
|
const address = parts[0] ?? "";
|
|
10617
|
-
const version = (0,
|
|
11484
|
+
const version = (0, import_node_net2.isIP)(address);
|
|
10618
11485
|
if (version === 0 || parts.length > 2) {
|
|
10619
11486
|
throw new NhnCloudCliError(
|
|
10620
11487
|
`--cidr\uC740 IP \uC8FC\uC18C \uB610\uB294 CIDR\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(value)}`,
|
|
@@ -10633,30 +11500,6 @@ function parseIpOrCidr(value) {
|
|
|
10633
11500
|
}
|
|
10634
11501
|
return normalized;
|
|
10635
11502
|
}
|
|
10636
|
-
function resolvedId(resource, label) {
|
|
10637
|
-
const id = resource.id.trim();
|
|
10638
|
-
if (!id) {
|
|
10639
|
-
throw new NhnCloudCliError(`${label} \uC870\uD68C \uACB0\uACFC\uC758 UUID\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.`, EXIT_PARAM_ERROR);
|
|
10640
|
-
}
|
|
10641
|
-
return id;
|
|
10642
|
-
}
|
|
10643
|
-
function resolveFromList(resources, input, label) {
|
|
10644
|
-
const exactId = resources.find((resource) => resource.id === input);
|
|
10645
|
-
if (exactId) return resolvedId(exactId, label);
|
|
10646
|
-
const nameMatches = resources.filter((resource) => resource.name === input);
|
|
10647
|
-
if (nameMatches.length === 1) return resolvedId(nameMatches[0], label);
|
|
10648
|
-
if (nameMatches.length === 0) {
|
|
10649
|
-
throw new NhnCloudCliError(
|
|
10650
|
-
`${label}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${JSON.stringify(input)}`,
|
|
10651
|
-
EXIT_PARAM_ERROR
|
|
10652
|
-
);
|
|
10653
|
-
}
|
|
10654
|
-
const candidateIds = nameMatches.map((resource) => resolvedId(resource, label)).sort();
|
|
10655
|
-
throw new NhnCloudCliError(
|
|
10656
|
-
`${label} \uC774\uB984\uC774 \uC911\uBCF5\uB429\uB2C8\uB2E4: ${JSON.stringify(input)} (\uD6C4\uBCF4 UUID: ${candidateIds.join(", ")})`,
|
|
10657
|
-
EXIT_PARAM_ERROR
|
|
10658
|
-
);
|
|
10659
|
-
}
|
|
10660
11503
|
async function resolveLoadBalancerId(client, value) {
|
|
10661
11504
|
const input = requireResourceInput(value, "Load Balancer");
|
|
10662
11505
|
const resources = await client.listLoadBalancers();
|
|
@@ -10691,7 +11534,7 @@ async function resolveLoadBalancerClient(opts) {
|
|
|
10691
11534
|
}
|
|
10692
11535
|
|
|
10693
11536
|
// src/commands/loadbalancer/list.ts
|
|
10694
|
-
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) => {
|
|
10695
11538
|
const opts = cmd.optsWithGlobals();
|
|
10696
11539
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
10697
11540
|
startSpinner("Load Balancer \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -10729,8 +11572,8 @@ var listCommand14 = new import_commander54.Command("list").description("Load Bal
|
|
|
10729
11572
|
});
|
|
10730
11573
|
|
|
10731
11574
|
// src/commands/loadbalancer/get.ts
|
|
10732
|
-
var
|
|
10733
|
-
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) => {
|
|
10734
11577
|
const opts = cmd.optsWithGlobals();
|
|
10735
11578
|
const input = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
10736
11579
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10767,10 +11610,10 @@ var getCommand9 = new import_commander55.Command("get").description("Load Balanc
|
|
|
10767
11610
|
});
|
|
10768
11611
|
|
|
10769
11612
|
// src/commands/loadbalancer/ipacl.ts
|
|
10770
|
-
var
|
|
11613
|
+
var import_commander62 = require("commander");
|
|
10771
11614
|
|
|
10772
11615
|
// src/commands/loadbalancer/target.ts
|
|
10773
|
-
var
|
|
11616
|
+
var import_commander61 = require("commander");
|
|
10774
11617
|
|
|
10775
11618
|
// src/commands/loadbalancer/rebind.ts
|
|
10776
11619
|
function shellQuote(value) {
|
|
@@ -10901,7 +11744,7 @@ function targetWriteResult(operation, target, rebind) {
|
|
|
10901
11744
|
rebind
|
|
10902
11745
|
};
|
|
10903
11746
|
}
|
|
10904
|
-
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) => {
|
|
10905
11748
|
const opts = cmd.optsWithGlobals();
|
|
10906
11749
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
10907
11750
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -10930,9 +11773,9 @@ var listCommand15 = new import_commander56.Command("list").description("IP ACL \
|
|
|
10930
11773
|
ids: targets.map((target) => target.id)
|
|
10931
11774
|
});
|
|
10932
11775
|
});
|
|
10933
|
-
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) => {
|
|
10934
11777
|
const opts = cmd.optsWithGlobals();
|
|
10935
|
-
|
|
11778
|
+
requireYes(opts.yes, "IP ACL \uB300\uC0C1 \uCD94\uAC00");
|
|
10936
11779
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
10937
11780
|
const parsedCidr = parseIpOrCidr(opts.cidr ?? "");
|
|
10938
11781
|
const parsedDescription = optionalTrimmed(opts.description);
|
|
@@ -10967,9 +11810,9 @@ var addCommand = new import_commander56.Command("add").description("IP ACL \uB30
|
|
|
10967
11810
|
writeTargetWarnings(group, result);
|
|
10968
11811
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
10969
11812
|
});
|
|
10970
|
-
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) => {
|
|
10971
11814
|
const opts = cmd.optsWithGlobals();
|
|
10972
|
-
|
|
11815
|
+
requireYes(opts.yes, "IP ACL \uB300\uC0C1 \uC0AD\uC81C");
|
|
10973
11816
|
const parsedTargetId = requireResourceInput(targetInput, "IP ACL \uB300\uC0C1");
|
|
10974
11817
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
10975
11818
|
startSpinner("IP ACL \uB300\uC0C1 \uC0AD\uC81C\uC640 Load Balancer \uC7AC\uBC14\uC778\uB529 \uC911...");
|
|
@@ -10998,13 +11841,13 @@ var removeCommand = new import_commander56.Command("remove").description("IP ACL
|
|
|
10998
11841
|
writeTargetWarnings(group, result);
|
|
10999
11842
|
if (result.status === "partial") process.exitCode = EXIT_API_ERROR;
|
|
11000
11843
|
});
|
|
11001
|
-
var targetCommand = new
|
|
11002
|
-
targetCommand.addCommand(
|
|
11844
|
+
var targetCommand = new import_commander61.Command("target").description("IP ACL \uB300\uC0C1 \uC870\uD68C\xB7\uAD00\uB9AC");
|
|
11845
|
+
targetCommand.addCommand(listCommand17);
|
|
11003
11846
|
targetCommand.addCommand(addCommand);
|
|
11004
11847
|
targetCommand.addCommand(removeCommand);
|
|
11005
11848
|
|
|
11006
11849
|
// src/commands/loadbalancer/ipacl.ts
|
|
11007
|
-
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) => {
|
|
11008
11851
|
const opts = cmd.optsWithGlobals();
|
|
11009
11852
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
11010
11853
|
startSpinner("IP ACL \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -11032,7 +11875,7 @@ var listCommand16 = new import_commander57.Command("list").description("IP ACL \
|
|
|
11032
11875
|
ids: groups.map((group) => group.id)
|
|
11033
11876
|
});
|
|
11034
11877
|
});
|
|
11035
|
-
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) => {
|
|
11036
11879
|
const opts = cmd.optsWithGlobals();
|
|
11037
11880
|
const input = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11038
11881
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -11065,7 +11908,7 @@ var getCommand10 = new import_commander57.Command("get").description("IP ACL \uA
|
|
|
11065
11908
|
ids: [group.id]
|
|
11066
11909
|
});
|
|
11067
11910
|
});
|
|
11068
|
-
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) => {
|
|
11069
11912
|
const opts = cmd.optsWithGlobals();
|
|
11070
11913
|
const parsedName = requireResourceInput(opts.name ?? "", "IP ACL \uADF8\uB8F9");
|
|
11071
11914
|
const parsedAction = parseIpAclAction(opts.action ?? "");
|
|
@@ -11096,9 +11939,9 @@ var createCommand9 = new import_commander57.Command("create").description("IP AC
|
|
|
11096
11939
|
ids: [group.id]
|
|
11097
11940
|
});
|
|
11098
11941
|
});
|
|
11099
|
-
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) => {
|
|
11100
11943
|
const opts = cmd.optsWithGlobals();
|
|
11101
|
-
const confirmedYes =
|
|
11944
|
+
const confirmedYes = requireYes(opts.yes, "IP ACL \uADF8\uB8F9 \uC0AD\uC81C");
|
|
11102
11945
|
const parsedGroup = requireResourceInput(groupInput, "IP ACL \uADF8\uB8F9");
|
|
11103
11946
|
if (confirmedYes) {
|
|
11104
11947
|
process.stderr.write(
|
|
@@ -11128,11 +11971,11 @@ var deleteCommand7 = new import_commander57.Command("delete").description("IP AC
|
|
|
11128
11971
|
ids: [groupId]
|
|
11129
11972
|
});
|
|
11130
11973
|
});
|
|
11131
|
-
var ipaclCommand = new
|
|
11132
|
-
ipaclCommand.addCommand(
|
|
11133
|
-
ipaclCommand.addCommand(
|
|
11134
|
-
ipaclCommand.addCommand(
|
|
11135
|
-
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);
|
|
11136
11979
|
ipaclCommand.addCommand(targetCommand);
|
|
11137
11980
|
|
|
11138
11981
|
// src/commands/loadbalancer/help.ts
|
|
@@ -11144,7 +11987,7 @@ function configureLoadBalancerHelp(command) {
|
|
|
11144
11987
|
}
|
|
11145
11988
|
|
|
11146
11989
|
// src/commands/loadbalancer/binding.ts
|
|
11147
|
-
var
|
|
11990
|
+
var import_commander63 = require("commander");
|
|
11148
11991
|
function bindingResult(operation, loadBalancerId, groupIds) {
|
|
11149
11992
|
return {
|
|
11150
11993
|
operation,
|
|
@@ -11166,13 +12009,13 @@ function outputBindingResult(opts, result) {
|
|
|
11166
12009
|
ids: [result.loadbalancer_id]
|
|
11167
12010
|
});
|
|
11168
12011
|
}
|
|
11169
|
-
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(
|
|
11170
12013
|
"--group <group>",
|
|
11171
12014
|
"\uC801\uC6A9\uD560 IP ACL \uADF8\uB8F9 \uC774\uB984 \uB610\uB294 UUID (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
11172
12015
|
collectOption
|
|
11173
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) => {
|
|
11174
12017
|
const opts = cmd.optsWithGlobals();
|
|
11175
|
-
const confirmedYes =
|
|
12018
|
+
const confirmedYes = requireYes(opts.yes, "Load Balancer IP ACL \uC5F0\uACB0 \uAD50\uCCB4");
|
|
11176
12019
|
const parsedLoadBalancer = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
11177
12020
|
const parsedGroups = requireResourceInputs(opts.group ?? [], "IP ACL \uADF8\uB8F9");
|
|
11178
12021
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
@@ -11206,9 +12049,9 @@ var setIpAclCommand2 = new import_commander58.Command("set-ipacl").description("
|
|
|
11206
12049
|
bindingResult("loadbalancer-set-ipacl", loadBalancerId, groupIds)
|
|
11207
12050
|
);
|
|
11208
12051
|
});
|
|
11209
|
-
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) => {
|
|
11210
12053
|
const opts = cmd.optsWithGlobals();
|
|
11211
|
-
const confirmedYes =
|
|
12054
|
+
const confirmedYes = requireYes(opts.yes, "Load Balancer IP ACL \uC5F0\uACB0 \uD574\uC81C");
|
|
11212
12055
|
const parsedLoadBalancer = requireResourceInput(loadBalancerInput, "Load Balancer");
|
|
11213
12056
|
const { client } = await resolveLoadBalancerClient(opts);
|
|
11214
12057
|
startSpinner("Load Balancer IP ACL \uC5F0\uACB0 \uD574\uC81C \uC911...");
|
|
@@ -11258,6 +12101,8 @@ var networkAgentWorkflow = `
|
|
|
11258
12101
|
Agent workflow:
|
|
11259
12102
|
1. nhncloud network list --json
|
|
11260
12103
|
2. nhncloud network subnet list --json
|
|
12104
|
+
3. nhncloud network security-group list --json
|
|
12105
|
+
4. nhncloud network security-group ports <group> --json
|
|
11261
12106
|
`;
|
|
11262
12107
|
var volumeAgentWorkflow = `
|
|
11263
12108
|
Agent workflow:
|
|
@@ -11295,8 +12140,8 @@ Agent workflow:
|
|
|
11295
12140
|
2. nhncloud ncs workload list --json
|
|
11296
12141
|
3. nhncloud ncs workload get <id> --json
|
|
11297
12142
|
`;
|
|
11298
|
-
var program = new
|
|
11299
|
-
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);
|
|
11300
12145
|
program.hook("preAction", () => {
|
|
11301
12146
|
const opts = program.opts();
|
|
11302
12147
|
const rawTimeout = opts.requestTimeout ?? process.env["NHNCLOUD_REQUEST_TIMEOUT"];
|
|
@@ -11317,32 +12162,33 @@ program.hook("preAction", () => {
|
|
|
11317
12162
|
}
|
|
11318
12163
|
});
|
|
11319
12164
|
program.addCommand(configureCommand);
|
|
11320
|
-
var logncrashCommand = new
|
|
12165
|
+
var logncrashCommand = new import_commander64.Command("logncrash").description("Log & Crash \uAD00\uB828 \uBA85\uB839").addHelpText("after", logncrashAgentWorkflow);
|
|
11321
12166
|
logncrashCommand.addCommand(availableTokenCommand);
|
|
11322
12167
|
logncrashCommand.addCommand(searchCommand);
|
|
11323
12168
|
logncrashCommand.addCommand(sendCommand);
|
|
11324
12169
|
logncrashCommand.addCommand(exportCommand);
|
|
11325
12170
|
program.addCommand(logncrashCommand);
|
|
11326
|
-
var deployCommand2 = new
|
|
12171
|
+
var deployCommand2 = new import_commander64.Command("deploy").description("NHN Cloud Deploy \uAD00\uB828 \uBA85\uB839").addHelpText("after", deployAgentWorkflow);
|
|
11327
12172
|
deployCommand2.hook("preSubcommand", async () => {
|
|
11328
12173
|
await warnLegacyDeployTargets();
|
|
11329
12174
|
});
|
|
11330
12175
|
deployCommand2.addCommand(runCommand);
|
|
11331
12176
|
deployCommand2.addCommand(artifactsCommand);
|
|
11332
12177
|
deployCommand2.addCommand(serverGroupsCommand);
|
|
12178
|
+
deployCommand2.addCommand(scenariosCommand);
|
|
11333
12179
|
deployCommand2.addCommand(historiesCommand);
|
|
11334
12180
|
deployCommand2.addCommand(binaryGroupsCommand);
|
|
11335
12181
|
deployCommand2.addCommand(binariesCommand);
|
|
11336
12182
|
deployCommand2.addCommand(uploadCommand);
|
|
11337
12183
|
deployCommand2.addCommand(downloadCommand);
|
|
11338
12184
|
program.addCommand(deployCommand2);
|
|
11339
|
-
var instanceCommand = new
|
|
12185
|
+
var instanceCommand = new import_commander64.Command("instance").description("Compute \uC778\uC2A4\uD134\uC2A4 \uAD00\uB828 \uBA85\uB839").addHelpText("after", instanceAgentWorkflow);
|
|
11340
12186
|
instanceCommand.addCommand(listCommand);
|
|
11341
12187
|
instanceCommand.addCommand(flavorsCommand);
|
|
11342
12188
|
instanceCommand.addCommand(availabilityZonesCommand);
|
|
11343
|
-
instanceCommand.addCommand(
|
|
11344
|
-
instanceCommand.addCommand(
|
|
11345
|
-
instanceCommand.addCommand(
|
|
12189
|
+
instanceCommand.addCommand(getCommand4);
|
|
12190
|
+
instanceCommand.addCommand(createCommand5);
|
|
12191
|
+
instanceCommand.addCommand(deleteCommand4);
|
|
11346
12192
|
instanceCommand.addCommand(startCommand);
|
|
11347
12193
|
instanceCommand.addCommand(stopCommand);
|
|
11348
12194
|
instanceCommand.addCommand(rebootCommand);
|
|
@@ -11354,50 +12200,52 @@ instanceCommand.addCommand(keypairsCommand);
|
|
|
11354
12200
|
instanceCommand.addCommand(keypairCommand);
|
|
11355
12201
|
instanceCommand.addCommand(volumeCommand);
|
|
11356
12202
|
instanceCommand.addCommand(volumesCommand);
|
|
12203
|
+
instanceCommand.addCommand(securityGroupCommand2);
|
|
11357
12204
|
program.addCommand(instanceCommand);
|
|
11358
|
-
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);
|
|
11359
12206
|
networkCommand.addCommand(listCommand3);
|
|
11360
12207
|
networkCommand.addCommand(subnetCommand);
|
|
12208
|
+
networkCommand.addCommand(securityGroupCommand);
|
|
11361
12209
|
program.addCommand(networkCommand);
|
|
11362
|
-
var volumeCommand2 = new
|
|
12210
|
+
var volumeCommand2 = new import_commander64.Command("volume").description("Block Storage \uBCFC\uB968 \uAD00\uB828 \uBA85\uB839").addHelpText("after", volumeAgentWorkflow);
|
|
11363
12211
|
volumeCommand2.addCommand(listCommand2);
|
|
11364
12212
|
volumeCommand2.addCommand(getCommand);
|
|
11365
12213
|
volumeCommand2.addCommand(createCommand);
|
|
11366
12214
|
program.addCommand(volumeCommand2);
|
|
11367
|
-
var floatingipCommand = new
|
|
12215
|
+
var floatingipCommand = new import_commander64.Command("floatingip").description(
|
|
11368
12216
|
"Floating IP(\uC778\uC2A4\uD134\uC2A4 \uACF5\uC778 IP) \uAD00\uB9AC"
|
|
11369
12217
|
).addHelpText("after", floatingIpAgentWorkflow);
|
|
11370
|
-
floatingipCommand.addCommand(
|
|
11371
|
-
floatingipCommand.addCommand(
|
|
11372
|
-
floatingipCommand.addCommand(
|
|
12218
|
+
floatingipCommand.addCommand(listCommand6);
|
|
12219
|
+
floatingipCommand.addCommand(createCommand4);
|
|
12220
|
+
floatingipCommand.addCommand(deleteCommand3);
|
|
11373
12221
|
program.addCommand(floatingipCommand);
|
|
11374
|
-
var loadbalancerCommand = new
|
|
11375
|
-
loadbalancerCommand.addCommand(
|
|
11376
|
-
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);
|
|
11377
12225
|
loadbalancerCommand.addCommand(ipaclCommand);
|
|
11378
12226
|
loadbalancerCommand.addCommand(setIpAclCommand2);
|
|
11379
12227
|
loadbalancerCommand.addCommand(clearIpAclCommand);
|
|
11380
12228
|
configureLoadBalancerHelp(loadbalancerCommand);
|
|
11381
12229
|
program.addCommand(loadbalancerCommand);
|
|
11382
|
-
var ncrCommand = new
|
|
11383
|
-
ncrCommand.addCommand(
|
|
11384
|
-
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);
|
|
11385
12233
|
ncrCommand.addCommand(imagesCommand2);
|
|
11386
12234
|
ncrCommand.addCommand(tagsCommand);
|
|
11387
12235
|
program.addCommand(ncrCommand);
|
|
11388
|
-
var nksCommand = new
|
|
12236
|
+
var nksCommand = new import_commander64.Command("nks").description("NHN Kubernetes Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", nksAgentWorkflow);
|
|
11389
12237
|
nksCommand.addCommand(supportsCommand);
|
|
11390
12238
|
nksCommand.addCommand(clusterCommand);
|
|
11391
12239
|
nksCommand.addCommand(nodegroupCommand);
|
|
11392
12240
|
nksCommand.addCommand(addonTypeCommand);
|
|
11393
12241
|
nksCommand.addCommand(addonCommand);
|
|
11394
12242
|
program.addCommand(nksCommand);
|
|
11395
|
-
var ncsCommand = new
|
|
12243
|
+
var ncsCommand = new import_commander64.Command("ncs").description("NHN Container Service \uAD00\uB828 \uBA85\uB839").addHelpText("after", ncsAgentWorkflow);
|
|
11396
12244
|
ncsCommand.addCommand(templateCommand);
|
|
11397
12245
|
ncsCommand.addCommand(workloadCommand);
|
|
11398
12246
|
ncsCommand.addCommand(malwareCommand);
|
|
11399
12247
|
program.addCommand(ncsCommand);
|
|
11400
|
-
var apiGatewayCommand = new
|
|
12248
|
+
var apiGatewayCommand = new import_commander64.Command("apigateway").description("NHN API Gateway \uC870\uD68C \uBA85\uB839");
|
|
11401
12249
|
apiGatewayCommand.addCommand(serviceCommand);
|
|
11402
12250
|
apiGatewayCommand.addCommand(resourceCommand);
|
|
11403
12251
|
apiGatewayCommand.addCommand(stageCommand);
|
|
@@ -11407,7 +12255,7 @@ program.addCommand(doctorCommand);
|
|
|
11407
12255
|
program.addCommand(createCommandsCommand(program));
|
|
11408
12256
|
configureCommanderExitCodes(program);
|
|
11409
12257
|
program.parseAsync().catch((err) => {
|
|
11410
|
-
if (err instanceof
|
|
12258
|
+
if (err instanceof import_commander64.CommanderError) {
|
|
11411
12259
|
process.exit(err.exitCode);
|
|
11412
12260
|
}
|
|
11413
12261
|
const message = sanitizeMultilineForTerminal(
|