Documentation Index

Fetch the complete documentation index at: https://cli-fin.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

CLI 사용

Prev Next

Ncloud CLI의 명령어 구조, 옵션 지정, 출력 형식 등을 설명합니다.

명령어 도움말

명령어 끝에 help를 추가하면 사용 가능한 명령어와 옵션을 확인할 수 있습니다.

최상위 명령어 목록을 확인하려면 다음과 같이 실행합니다.

./ncloud help

상위 명령어의 하위 명령어를 확인하려면 다음과 같이 실행합니다.

./ncloud vserver help
./ncloud vloadbalancer help

명령어 구조

Ncloud CLI는 명령줄에서 멀티파트 구조를 사용합니다. 이 구조는 Ncloud에 대한 기본 호출로 시작되며 명령어마다 수행할 작업에 대한 하위 명령이 있습니다. CLI에서 옵션을 어떤 순서로 지정하든 상관없습니다.

./ncloud <command> <subcommand> [options]

옵션 지정

옵션에 전달하는 값은 대부분 문자열이나 숫자입니다. 그 외에 List, Map 형식의 값을 전달할 수 있습니다.

List 형식

List 형식의 값은 공백( ), 콤마(,), 또는 옵션을 반복 선언하여 전달할 수 있습니다.

./ncloud vserver getPublicIpInstanceList --publicIpInstanceNoList 573361 571968
./ncloud vserver getPublicIpInstanceList --publicIpInstanceNoList 573361,571968
./ncloud vserver getPublicIpInstanceList --publicIpInstanceNoList 573361 --publicIpInstanceNoList 571968

Map 형식

공백 문자가 없는 문자열은 따옴표로 묶거나 묶지 않을 수 있습니다. 그러나 Map 형식의 문자열은 따옴표로 묶어야 합니다. 다음 예시에서와 같이 Linux, MacOS, Unix 및 Windows PowerShell에서는 작은따옴표(')나 큰따옴표(")가 사용 가능하고, Windows 명령 프롬프트에서는 큰따옴표(")를 사용합니다.

  • Windows PowerShell, Linux, MacOS, Unix

    ./ncloud vserver createServerInstances --serverName test-server-01 --networkInterfaceList 'networkInterfaceOrder="0",accessControlGroupNoList=["67890123","6789024"]'
    
  • Windows 명령 프롬프트

    ./ncloud vserver createServerInstances --serverName test-server-01 --networkInterfaceList "networkInterfaceOrder='0',accessControlGroupNoList=['67890123','6789024']"
    

Timeout 설정

Read Timeout과 Connect Timeout 시간을 설정할 수 있습니다. 초 단위로 설정 가능하며, 기본값은 300초입니다.

./ncloud vserver getZoneList --read-timeout 10
./ncloud vserver getZoneList --connect-timeout 5

출력 형식

Ncloud CLI는 두 가지 출력 형식을 지원합니다. --output 옵션이 없으면 기본 JSON 포맷으로 출력됩니다. XML로 출력하려는 경우, 다음과 같이 실행해 주십시오.

./ncloud vserver getZoneList --output xml