How to get Image List with REST API - cloud-barista/cb-spider GitHub Wiki
[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. 응용: 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", ```