REST API Region Zone Information Guide - cloud-barista/cb-spider GitHub Wiki
[How to Use Region/Zone Information Based on REST API]
-
Reference: [Region/Zone REST API Specification (since v0.8.5)](CB-Spider-User-Interface)
-
Reference: [AdminWeb Region/Zone Usage Guide](AdminWeb-Region-Zone-Information-Guide)
1. APIs Available Before Connection Configuration
-
APIs to get Region/Zone information using Driver Name and Credential Name before connection configuration
- ※ Connection Configuration (Connection Config): A connection name (Connection ID) composed of DriverName + CredentialName + RegionName
-
(Preparation) Check registered cloud driver and credential information (obtain
DriverName,CredentialName)curl -sX GET http://localhost:1024/spider/driver |json_pp;curl -sX GET http://localhost:1024/spider/credential |json_pp;
(1) How to Use Region/Zone Information Based on REST API
-
How to get all AWS Region/Zone information
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=aws-driver01&CredentialName=aws-credential01" | json_pp -
output:
{ "regionzone" : [ { "DisplayName" : "ap-northeast-2", "KeyValueList" : [], "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" }, --More--
-
(2) How to get Region/Zone information for a specific AWS Region
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/ap-northeast-2?DriverName=aws-driver01&CredentialName=aws-credential01" | json_pp -
output:
{ "DisplayName" : "ap-northeast-2", "KeyValueList" : [], "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, --More--
-
(3) How to get all original AWS Region information
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=aws-driver01&CredentialName=aws-credential01" | 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" }, { "Endpoint" : "ec2.me-central-1.amazonaws.com", "OptInStatus" : "opted-in", "RegionName" : "me-central-1" --More--
2. APIs Available After Connection Configuration
- APIs to get Region/Zeon information using the connection name (ConnectionName)
(Preparation) Check registered cloud connection configuration information (obtain ConnectionName)
curl -sX GET http://localhost:1024/spider/connectionconfig |json_pp;
(1) How to Use Region/Zone Information Based on REST API
-
How to get all AWS Region/Zone information
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=aws-config01" | json_pp -
output:
{ "regionzone" : [ { "DisplayName" : "ap-northeast-2", "KeyValueList" : [], "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" }, { --More--
-
(2) How to get Region/Zone information for a specific AWS Region
curl -sX GET "http://localhost:1024/spider/regionzone/ap-northeast-2?ConnectionName=aws-config01" | json_pp -
output:
{ "DisplayName" : "ap-northeast-2", "KeyValueList" : [], "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, --More--
-
(3) How to get all original AWS Region information
curl -sX GET "http://localhost:1024/spider/orgregion?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" }, { "Endpoint" : "ec2.me-central-1.amazonaws.com", "OptInStatus" : "opted-in", "RegionName" : "me-central-1" --More--
-
(4) How to get all original AWS Zone information
curl -sX GET "http://localhost:1024/spider/orgzone?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", --More--
[Special Notes and Advance Configuration Guide]
-
For the RegionZopnePreConfig API that uses only DriverName and CredentialName before connection configuration
-
Due to CSP characteristics, there are CSPs for which Region information is absolutely required
- AWS, Alibaba: It is mandatory to set the target Region for CSP API execution requests
- Tencent: The Driver verifies whether the Zone setting is configured before Connection setup (not required in the Tencent API, but respected for driver stability)
-
=> Add Default Region To Query setting in cloudos_meta.yaml
-
Currently, for AWS, Alibaba, and Tencent, the default Region/Zone is set to each CSP’s Seoul Region and the first Zone
-
You can change it to any desired Region/Zone if needed
-
References,
-
[Examples of Using RegionZone API]
[Mock]
- Before connection configuration
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=mock-driver-01&CredentialName=mock-credential-01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/neptune?DriverName=mock-driver-01&CredentialName=mock-credential-01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=mock-driver-01&CredentialName=mock-credential-01" | json_pp
- After connection configuration
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=mock-config-01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/neptune?ConnectionName=mock-config-01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=mock-config-01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=mock-config-01" | json_pp
[AWS] (cloudos_meta.yaml: using default Region/Zone)
- Before connection configuration
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=aws-driver01&CredentialName=aws-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/ap-northeast-2?DriverName=aws-driver01&CredentialName=aws-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=aws-driver01&CredentialName=aws-credential01" | json_pp
- After connection configuration
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=aws-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/ap-northeast-2?ConnectionName=aws-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=aws-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=aws-config01" | json_pp
[Azure]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=azure-driver01&CredentialName=azure-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/australiacentral?DriverName=azure-driver01&CredentialName=azure-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=azure-driver01&CredentialName=azure-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=azure-northeu-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/australiacentral?ConnectionName=azure-northeu-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=azure-northeu-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=azure-northeu-config" | json_pp
[GCP]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=gcp-driver01&CredentialName=gcp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/me-central1?DriverName=gcp-driver01&CredentialName=gcp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=gcp-driver01&CredentialName=gcp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=gcp-iowa-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/me-central1?ConnectionName=gcp-iowa-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=gcp-iowa-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=gcp-iowa-config" | json_pp
[Alibaba] (cloudos_meta.yaml: using default Region/Zone)
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=alibaba-driver01&CredentialName=alibaba-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/cn-hangzhou?DriverName=alibaba-driver01&CredentialName=alibaba-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=alibaba-driver01&CredentialName=alibaba-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=alibaba-beijing-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/cn-hangzhou?ConnectionName=alibaba-beijing-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=alibaba-beijing-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=alibaba-beijing-config" | json_pp
[Tencent] (cloudos_meta.yaml: using default Region/Zone)
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=tencent-driver01&CredentialName=tencent-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/sa-saopaulo?DriverName=tencent-driver01&CredentialName=tencent-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=tencent-driver01&CredentialName=tencent-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=tencent-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/sa-saopaulo?ConnectionName=tencent-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=tencent-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=tencent-seoul1-config" | json_pp
[OpenStack]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=openstack-driver01&CredentialName=openstack-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/RegionOne?DriverName=openstack-driver01&CredentialName=openstack-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=openstack-driver01&CredentialName=openstack-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=openstack-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/RegionOne?ConnectionName=openstack-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=openstack-config01" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=openstack-config01" | json_pp
[ncp]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=ncp-driver01&CredentialName=ncp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/SGN?DriverName=ncp-driver01&CredentialName=ncp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=ncp-driver01&CredentialName=ncp-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=ncp-korea1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/SGN?ConnectionName=ncp-korea1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=ncp-korea1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=ncp-korea1-config" | json_pp
[NHN]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=nhn-driver01&CredentialName=nhn-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/JP1?DriverName=nhn-driver01&CredentialName=nhn-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=nhn-driver01&CredentialName=nhn-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=nhn-korea-pangyo-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/JP1?ConnectionName=nhn-korea-pangyo-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=nhn-korea-pangyo-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=nhn-korea-pangyo-config" | json_pp
[KT]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=kt-driver01&CredentialName=kt-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/KR1?DriverName=kt-driver01&CredentialName=kt-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=kt-driver01&CredentialName=kt-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=kt-mokdong1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/KR1?ConnectionName=kt-mokdong1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=kt-mokdong1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=kt-mokdong1-config" | json_pp
[KTCLASSIC]
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone?DriverName=ktclassic-driver01&CredentialName=ktclassic-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/regionzone/KOR-Seoul?DriverName=ktclassic-driver01&CredentialName=ktclassic-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/preconfig/orgregion?DriverName=ktclassic-driver01&CredentialName=ktclassic-credential01" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone?ConnectionName=ktclassic-korea-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/regionzone/KOR-Seoul?ConnectionName=ktclassic-korea-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgregion?ConnectionName=ktclassic-korea-seoul1-config" | json_pp
curl -sX GET "http://localhost:1024/spider/orgzone?ConnectionName=ktclassic-korea-seoul1-config" | json_pp