Skip to content

REST API Region Zone Information Guide

ByoungSeob Kim edited this page Oct 12, 2023 · 11 revisions

[REST API 기반 Region/Zone 정보 활용 방법]


1. 등록된 클라우드 연결 설정 정보 확인(ConnectionName)

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

2. REST API 기반 Region/Zone 정보 활용 방법

  • (1) AWS 전체 Region/Zone 정보 얻는 방법

curl -sX GET http://localhost:1024/spider/regionzone -H 'Content-Type: application/json' -d '{"ConnectionName": "aws-config01"}' | json_pp
  • output:

    {
       "regionzone" : [
          {
             "DisplayName" : "ap-northeast-2",
             "KeyValueList" : null,
             "Name" : "ap-northeast-2",
             "ZoneList" : [
                {
                   "DisplayName" : "ap-northeast-2a",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2a",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-2b",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2b",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-2c",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2c",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-2d",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2d",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-2-wl1-cjj-wlz-1",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2-wl1-cjj-wlz-1",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-2-wl1-sel-wlz-1",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-2-wl1-sel-wlz-1",
                   "Status" : "Available"
                }
             ]
          },
          {
             "DisplayName" : "ap-northeast-3",
             "KeyValueList" : null,
             "Name" : "ap-northeast-3",
             "ZoneList" : [
                {
                   "DisplayName" : "ap-northeast-3a",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-3a",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-3b",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-3b",
                   "Status" : "Available"
                },
                {
                   "DisplayName" : "ap-northeast-3c",
                   "KeyValueList" : null,
                   "Name" : "ap-northeast-3c",
                   "Status" : "Available"
                }
             ]
          },
          ...
    

  • (2) AWS 특정 Region의 Region/Zone 정보 얻는 방법

curl -sX GET http://localhost:1024/spider/regionzone/ap-northeast-3 -H 'Content-Type: application/json' -d '{"ConnectionName": "aws-config01"}' | json_pp
  • output:

    {
       "DisplayName" : "ap-northeast-3",
       "KeyValueList" : null,
       "Name" : "ap-northeast-3",
       "ZoneList" : [
          {
             "DisplayName" : "ap-northeast-3a",
             "KeyValueList" : null,
             "Name" : "ap-northeast-3a",
             "Status" : "Available"
          },
          {
             "DisplayName" : "ap-northeast-3b",
             "KeyValueList" : null,
             "Name" : "ap-northeast-3b",
             "Status" : "Available"
          },
          {
             "DisplayName" : "ap-northeast-3c",
             "KeyValueList" : null,
             "Name" : "ap-northeast-3c",
             "Status" : "Available"
          }
       ]
    }

  • (3) AWS 전체 Region 원본 정보 얻는 방법

curl -sX GET http://localhost:1024/spider/orgregion -H 'Content-Type: application/json' -d '{"ConnectionName": "aws-config01"}' | json_pp 
  • output:

    {
       "Regions" : [
          {
             "Endpoint" : "ec2.ap-south-2.amazonaws.com",
             "OptInStatus" : "not-opted-in",
             "RegionName" : "ap-south-2"
          },
          {
             "Endpoint" : "ec2.ap-south-1.amazonaws.com",
             "OptInStatus" : "opt-in-not-required",
             "RegionName" : "ap-south-1"
          },
          {
             "Endpoint" : "ec2.eu-south-1.amazonaws.com",
             "OptInStatus" : "opted-in",
             "RegionName" : "eu-south-1"
          },
          {
             "Endpoint" : "ec2.eu-south-2.amazonaws.com",
             "OptInStatus" : "not-opted-in",
             "RegionName" : "eu-south-2"
          },
          ...

  • (4) AWS 전체 Zone 원본 정보 얻는 방법

curl -sX GET http://localhost:1024/spider/orgzone -H 'Content-Type: application/json' -d '{"ConnectionName": "aws-config01"}' | json_pp 
  • output:

    [
       {
          "AvailabilityZones" : [
             {
                "GroupName" : "ap-south-1",
                "Messages" : null,
                "NetworkBorderGroup" : "ap-south-1",
                "OptInStatus" : "opt-in-not-required",
                "ParentZoneId" : null,
                "ParentZoneName" : null,
                "RegionName" : "ap-south-1",
                "State" : "available",
                "ZoneId" : "aps1-az1",
                "ZoneName" : "ap-south-1a",
                "ZoneType" : "availability-zone"
             },
             {
                "GroupName" : "ap-south-1",
                "Messages" : null,
                "NetworkBorderGroup" : "ap-south-1",
                "OptInStatus" : "opt-in-not-required",
                "ParentZoneId" : null,
                "ParentZoneName" : null,
                "RegionName" : "ap-south-1",
                "State" : "available",
                "ZoneId" : "aps1-az3",
                "ZoneName" : "ap-south-1b",
                "ZoneType" : "availability-zone"
             },
             {
                "GroupName" : "ap-south-1",
                "Messages" : null,
                "NetworkBorderGroup" : "ap-south-1",
                "OptInStatus" : "opt-in-not-required",
                "ParentZoneId" : null,
                "ParentZoneName" : null,
                "RegionName" : "ap-south-1",
                "State" : "available",
                "ZoneId" : "aps1-az2",
                "ZoneName" : "ap-south-1c",
                "ZoneType" : "availability-zone"
             },
             {
                "GroupName" : "ap-south-1-ccu-1",
                "Messages" : null,
                "NetworkBorderGroup" : "ap-south-1-ccu-1",
                "OptInStatus" : "not-opted-in",
                "ParentZoneId" : "aps1-az1",
                "ParentZoneName" : "ap-south-1a",
                "RegionName" : "ap-south-1",
                "State" : "available",
                "ZoneId" : "aps1-ccu1-az1",
                "ZoneName" : "ap-south-1-ccu-1a",
                "ZoneType" : "local-zone"
             },
             {
                "GroupName" : "ap-south-1-del-1",
                "Messages" : null,
                "NetworkBorderGroup" : "ap-south-1-del-1",
                "OptInStatus" : "not-opted-in",
                "ParentZoneId" : "aps1-az3",
                "ParentZoneName" : "ap-south-1b",
                "RegionName" : "ap-south-1",
                "State" : "available",
                "ZoneId" : "aps1-del1-az1",
                "ZoneName" : "ap-south-1-del-1a",
                "ZoneType" : "local-zone"
             }
          ]
       },
          ...

Table of contents



Clone this wiki locally