Quota Info Guide(KR) - cloud-barista/cb-spider GitHub Wiki
Quota Info Guide
1. CB-Spider Quota Info ๊ฐ์
- ์ฌ์ฉ์๋ CSP๊ฐ ์ ๊ณตํ๋ ์๋น์ค ํ์ ๋ณ Quota ์ ๋ณด(ํ๋, ์ฌ์ฉ๋, ๊ฐ์ฉ๋)๋ฅผ ์กฐํํ ์ ์๋ค.
- Quota ์กฐํ๋ 2๋จ๊ณ๋ก ์งํ๋๋ค.
ListQuotaServiceType๋ก ์๋น์ค ํ์ ๋ชฉ๋ก ์กฐํGetQuotaInfo๋ก ํน์ ์๋น์ค ํ์ ์ Quota ์์ธ ์กฐํ
- CB-Spider๋ CSP๊ฐ ์ ๊ณตํ๋ ์๋ณธ Quota ํญ๋ชฉ์ ์ต๋ํ ๊ทธ๋๋ก ์ ๋ฌํ๋ฉฐ, CSP๊ฐ ์ ๊ณตํ์ง ์๋ ๊ฐ์
NA๋ก ๋ฐํํ๋ค. - ์ง์ CSP: AWS, Azure, GCP, Alibaba
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CB-Spider Quota Info โ
โ โ
โ ConnectionName (CSP + Region) โ
โ โ โ
โ โโโ ListQuotaServiceType() โ
โ โ โโโ ServiceType ๋ชฉ๋ก โ
โ โ ์: ec2, eks, Compute โ
โ โ compute.googleapis.com, ecs โ
โ โ โ
โ โโโ GetQuotaInfo(ServiceType) โ
โ โโโ Quotas โ
โ โโโ QuotaName โ
โ โโโ Limit โ
โ โโโ Used โ
โ โโโ Available โ
โ โโโ Unit โ
โ โโโ Description โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2. ์ฌ์ ์ค๋น ์ฌํญ
2.1 ๊ณตํต
- ๋์ CSP Connection์ด ์ ์์ ์ผ๋ก ๋ฑ๋ก๋์ด ์์ด์ผ ํ๋ค.
2.2 GCP ์ฌ์ ์ค๋น
- GCP Project์์ Cloud Quotas API ํ์ฑํ๊ฐ ํ์ํ๋ค.
- ํ์ฑํ ์์:
- GCP Console: https://console.cloud.google.com/apis/library/cloudquotas.googleapis.com?project=spider
- gcloud CLI:
gcloud services enable cloudquotas.googleapis.com --project=123456789012
3. CB-Spider Quota API ๋ฐ ์ ๊ณต ์ ๋ณด ๊ท๊ฒฉ
- ์ฌ์ฉ์๋ ๋ค์๊ณผ ๊ฐ์ CB-Spider REST API๋ฅผ ์ด์ฉํ์ฌ Quota ์ ๋ณด๋ฅผ JSON ๊ท๊ฒฉ์ผ๋ก ์ ๊ณต๋ฐ๋๋ค.
3.1 Quota API
# Quota ์๋น์ค ํ์
๋ชฉ๋ก
GET /spider/quotaservicetype - List Quota Service Types
# ํน์ ์๋น์ค ํ์
์ Quota ์์ธ
GET /spider/quotainfo - Get Quota Info
3.2 ์์ฒญ ํ๋ผ๋ฏธํฐ
ListQuotaServiceType
| ํ๋ผ๋ฏธํฐ | ์ค๋ช | ์์ |
|---|---|---|
| ConnectionName | Quota ์ ๋ณด๋ฅผ ์กฐํํ ๋์ Connection ์ด๋ฆ | aws-seoul-config, gcp-seoul-config |
GetQuotaInfo
| ํ๋ผ๋ฏธํฐ | ์ค๋ช | ์์ |
|---|---|---|
| ConnectionName | Quota ์ ๋ณด๋ฅผ ์กฐํํ ๋์ Connection ์ด๋ฆ | aws-seoul-config |
| ServiceType | ListQuotaServiceType API๋ก ์กฐํํ ์๋น์ค ํ์
์ด๋ฆ |
ec2, compute.googleapis.com, ecs |
3.3 ์ ๊ณต ์ ๋ณด ๊ท๊ฒฉ
Quota ์ ๋ณด (QuotaInfo)
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| CSP | ํด๋ผ์ฐ๋ ์ ๊ณต์ ์ด๋ฆ | AWS, AZURE, GCP, ALIBABA |
| Region | Quota๊ฐ ์ ์ฉ๋๋ ๋ฆฌ์ /์์น | ap-northeast-2, koreacentral, asia-northeast3, cn-beijing |
| Quotas | ์๋น์ค ํ์ ์ ์ํ Quota ์์ธ ๋ชฉ๋ก | ์๋ Quota ์ฐธ์กฐ |
Quota ์์ธ ์ ๋ณด (Quota)
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| QuotaName | Quota ํญ๋ชฉ ์ด๋ฆ | Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances, CPUs |
| Limit | Quota ํ๋ ๊ฐ | 500, 24, 801 |
| Used | ํ์ฌ ์ฌ์ฉ๋ | 12, 8, 26 |
| Available | ์ฌ์ฉ ๊ฐ๋ฅ ์์ฌ๋ (Limit - Used) |
488, 16, 775 |
| Unit | Quota ๋จ์ | count, vCPU, Count, NA |
| Description | Quota ๋ถ๊ฐ ์ ๋ณด | AWS QuotaArn ๋ฑ |
์ฐธ๊ณ
- CSP๊ฐ
Used,Available,Unit๋ฑ์ ์ ๊ณตํ์ง ์์ผ๋ฉด ํด๋น ๊ฐ์NA๋ก ๋ฐํ๋๋ค.- Quota ํญ๋ชฉ ์ด๋ฆ๊ณผ ์ค๋ช ์ CSP ์๋ณธ ๊ฐ์ ์ต๋ํ ๊ทธ๋๋ก ์ ๋ฌํ๋ค.
4. CB-Spider Quota API ์์
4.1 ์๋น์ค ํ์ ๋ชฉ๋ก ์กฐํ ์์
curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX 'GET' 'http://localhost:1024/spider/quotaservicetype?ConnectionName=aws-seoul-config' | jq
์๋ต ์์:
{
"ServiceTypes": [
"ec2",
"vpc",
"ebs",
...
]
}
4.2 ํน์ ์๋น์ค ํ์ Quota ์กฐํ ์์
curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX 'GET' 'http://localhost:1024/spider/quotainfo?ConnectionName=aws-seoul-config&ServiceType=ec2' | jq
์๋ต ์์:
{
"CSP": "AWS",
"Region": "ap-northeast-2",
"Quotas": [
{
"QuotaName": "Attachments per transit gateway",
"Limit": "5000",
"Used": "NA",
"Available": "NA",
"Unit": "None",
"Description": "QuotaArn=arn:aws:servicequotas:ap-northeast-2:635484366616:ec2/L-E0233F82"
},
{
"QuotaName": "Running Dedicated z1d Hosts",
"Limit": "2",
"Used": "NA",
"Available": "NA",
"Unit": "None",
"Description": "QuotaArn=arn:aws:servicequotas:ap-northeast-2:635484366616:ec2/L-F035E935"
},
{
"QuotaName": "Concurrent TRN1 Capacity Blocks per account",
"Limit": "32768",
"Used": "NA",
"Available": "NA",
"Unit": "None",
...
}
]
}
5. Quota ์ํ ๊ฒฐ๊ณผ
- ์ํ ๋๊ตฌ: test/quota-info-test/quota-info-test.sh
- ์ํ ํญ๋ชฉ: ์๋น์ค ํ์ ์ ๊ณต ์ํ ๋ฐ ์๋น์ค ํ์ ๋ณ Quota Info ์ ๊ณต ์ํ
5.1 AWS: Pass
============================================================
Test Result Summary
============================================================
Connection : aws-seoul-config
Service Types : 218
Success : 218
Failure : 0
============================================================
5.2 Azure: Pass
============================================================
Test Result Summary
============================================================
Connection : azure-koreacentral-config
Service Types : 14
Success : 14
Failure : 0
============================================================
5.3 GCP: Pass
============================================================
Test Result Summary
============================================================
Connection : gcp-seoul-config
Service Types : 46
Success : 46
Failure : 0
============================================================
5.4 Alibaba: Pass
- ์ํ์์๋ ์๋ 4๊ฐ ์๋น์ค ํ์ ์ด ํ์ฌ ๋ฆฌ์ ๋ฏธ์ง์์ผ๋ก ์๋ฌ๋ฅผ ๋ฐํํ์์ผ๋ฉฐ,
- ์ด๋ ์ ์์ ์ธ ์์ธ ์ํฉ(์ธ๋ถ ๋ด์ฉ
์ฃผ์ ์ฌํญ ๋ฐ ์ ์ฝ์ฌํญ์ฐธ๊ณ )rosopenapiexplorersascloudsso
============================================================
Test Result Summary
============================================================
Connection : alibaba-beijing-config
Service Types : 66
Success : 62
Failure : 4
============================================================
6. ์ฃผ์์ฌํญ ๋ฐ ์ ์ฝ์ฌํญ
6.1 ์๋น์ค ํ์ ์ CSP๋ณ ํ์์ด ๋ค๋ฆ
- AWS:
ec2,vpc,ebs,eks๋ฑ - Azure:
Compute,ContainerService๋ฑ - GCP:
compute.googleapis.com,container.googleapis.com๋ฑ - Alibaba:
ecs,csk๋ฑ
6.2 Alibaba ๋ฆฌ์ ๋ณ ์๋น์ค ์ ๊ณต ์ฐจ์ด
- Alibaba ์๋น์ค ํ์
๋ชฉ๋ก์๋ Region ๋ฏธ์ง์ ํญ๋ชฉ์ด ํฌํจ๋ ์ ์๋ค.
- ํ์ฌ Region์์ ์ ๊ณตํ๋ ์๋น์ค ํ์ ๋ชฉ๋ก์ ํ๋ฒ์ ์ป๋ API ๋ถ์ฌ
- ์ ๊ณตํ๋ ์๋น์ค ํ์ ํํฐ๋ง ์ํด์๋ ๋ง์ GetQuota API ํธ์ถ ํ์
- ์ฆ, ํน์ ์๋น์ค ํ์
์ ๋ํด
GetQuotaInfo์์ฒญ ์ ๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์๋ค.ErrorCode: QUOTA.DIMENSION.VALUE.UNSUPPORT
6.3 Alibaba ์ค๊ตญ ๊ณ์ ์ Quota ์ ๋ณด ์ธ์ด
- Alibaba ์ค๊ตญ ๊ณ์ ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, Quota API๊ฐ ๋ฐํํ๋
QuotaName๋ฐDescription๋ฑ์ด ์ค๊ตญ์ด๋ก ์ ๊ณต๋๋ค. - ์ด๋ Alibaba API์ ์ธ์ด ์ต์ ์ผ๋ก ํด๊ฒฐํ ์ ์๋ CSP ์ ์ฑ ์ผ๋ก ์ถ์ ๋จ
{
"QuotaName": "ๅๆฌกๅฏ่ดญไนฐ็ๅ
ๅนดๅ
ๆๅฎไพ็ๆๅคงๆฐ้",
"Limit": "300",
"Used": "0",
"Available": "300",
"Unit": "NA",
"Description": "ๅๆฌกๅฏ่ดญไนฐ็ๅ
ๅนดๅ
ๆecs็ๆๅคงๆฐ้"
}
7. API ์๋ต ์ฝ๋
| HTTP Status | ์ค๋ช |
|---|---|
| 200 OK | ์์ฒญ ์ฑ๊ณต |
| 400 Bad Request | ์๋ชป๋ ์์ฒญ (ํ์ ํ๋ผ๋ฏธํฐ ๋๋ฝ, ์๋ชป๋ ์๋น์ค ํ์ ๋ฑ) |
| 404 Not Found | ๋์ ๋ฆฌ์์ค๋ฅผ ์ฐพ์ ์ ์์ |
| 500 Internal Server Error | ์๋ฒ ๋ด๋ถ ์ค๋ฅ ๋๋ CSP API ์ค๋ฅ |