Quota Info Guide(KR) - cloud-barista/cb-spider GitHub Wiki

Quota Info Guide

Language: English | ํ•œ๊ตญ์–ด

1. CB-Spider Quota Info ๊ฐœ์š”

  • ์‚ฌ์šฉ์ž๋Š” CSP๊ฐ€ ์ œ๊ณตํ•˜๋Š” ์„œ๋น„์Šค ํƒ€์ž…๋ณ„ Quota ์ •๋ณด(ํ•œ๋„, ์‚ฌ์šฉ๋Ÿ‰, ๊ฐ€์šฉ๋Ÿ‰)๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋‹ค.
  • Quota ์กฐํšŒ๋Š” 2๋‹จ๊ณ„๋กœ ์ง„ํ–‰๋œ๋‹ค.
    1. ListQuotaServiceType๋กœ ์„œ๋น„์Šค ํƒ€์ž… ๋ชฉ๋ก ์กฐํšŒ
    2. 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 ์‚ฌ์ „ ์ค€๋น„

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๊ฐœ ์„œ๋น„์Šค ํƒ€์ž…์ด ํ˜„์žฌ ๋ฆฌ์ „ ๋ฏธ์ง€์›์œผ๋กœ ์—๋Ÿฌ๋ฅผ ๋ฐ˜ํ™˜ํ•˜์˜€์œผ๋ฉฐ,
  • ์ด๋Š” ์ •์ƒ์ ์ธ ์˜ˆ์™ธ ์ƒํ™ฉ(์„ธ๋ถ€ ๋‚ด์šฉ ์ฃผ์˜ ์‚ฌํ•ญ ๋ฐ ์ œ์•ฝ์‚ฌํ•ญ ์ฐธ๊ณ )
    • ros
    • openapiexplorer
    • sas
    • cloudsso
============================================================
 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 ์˜ค๋ฅ˜

8. ์ฐธ๊ณ  ์ž๋ฃŒ