Skip to content

How to get Image List with REST API

ByoungSeob Kim edited this page Sep 5, 2024 · 4 revisions

[REST API: VM Image 정보 참조 방법]

1. 클라우드 연결 설정 정보 확인

curl -sX GET http://localhost:1024/spider/connectionconfig -H 'Content-Type: application/json' |json_pp;

2. VM Image 정보 리스트 얻기

export CONN_CONFIG=alibaba-tokyo-config;
curl -sX GET http://localhost:1024/spider/vmimage -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp;

3. 특정 VM Image 정보 얻기

export CONN_CONFIG=alibaba-tokyo-config;
curl -sX GET http://localhost:1024/spider/vmimage/ubuntu_20_04_x64_20G_alibase_20240819.vhd -H 'Content-Type: application/json' -d '{ "ConnectionName":
"'${CONN_CONFIG}'"}' |json_pp
  • output 예시:

    {
       "GuestOS" : "Ubuntu  20.04 64 bit",
       "IId" : {
          "NameId" : "ubuntu_20_04_x64_20G_alibase_20240819.vhd",
          "SystemId" : "ubuntu_20_04_x64_20G_alibase_20240819.vhd"
       },
       "KeyValueList" : [
          {
             "Key" : "CreationTime",
             "Value" : "2024-08-21T08:02:47Z"
          },
          {
             "Key" : "Architecture",
             "Value" : "x86_64"
          },
              ... 중략 ...

4. 응용: ubuntu를 제공하는 VM Image의 Name ID 정보 리스트 얻기

export CONN_CONFIG=alibaba-tokyo-config;
curl -sX GET http://localhost:1024/spider/vmimage -H 'Content-Type: application/json' -d '{ "ConnectionName":
"'${CONN_CONFIG}'"}' |json_pp |grep NameId |grep ubuntu;
  • output 예시:

    "NameId" : "ubuntu_20_04_x64_20G_alibase_20210420.vhd"
    "NameId" : "ubuntu_18_04_x64_20G_alibase_20210420.vhd"
    "NameId" : "ubuntu_16_04_x64_20G_alibase_20210420.vhd",
    "NameId" : "ubuntu_16_0402_32_20G_alibase_20180409.vhd"
    "NameId" : "ubuntu_14_0405_64_20G_alibase_20170824.vhd",
    

Table of contents



Clone this wiki locally