Quota Info Guide - cloud-barista/cb-spider GitHub Wiki

Quota Info Guide

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

1. CB-Spider Quota Info Overview

  • Users can retrieve quota information (limit, usage, available) per service type provided by each CSP.
  • Quota retrieval is a two-step process:
    1. Call ListQuotaServiceType to get the list of available service types.
    2. Call GetQuotaInfo with a specific service type to retrieve detailed quota information.
  • CB-Spider passes through the CSP's original quota items as-is. Values not exposed by the CSP are returned as NA.
  • Supported CSPs: AWS, Azure, GCP, Alibaba
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    CB-Spider Quota Info                     โ”‚
โ”‚                                                             โ”‚
โ”‚  ConnectionName (CSP + Region)                              โ”‚
โ”‚        โ”‚                                                    โ”‚
โ”‚        โ”œโ”€โ”€ ListQuotaServiceType()                           โ”‚
โ”‚        โ”‚      โ””โ”€โ”€ ServiceType list                          โ”‚
โ”‚        โ”‚           e.g. ec2, eks, Compute                   โ”‚
โ”‚        โ”‚                compute.googleapis.com, ecs         โ”‚
โ”‚        โ”‚                                                    โ”‚
โ”‚        โ””โ”€โ”€ GetQuotaInfo(ServiceType)                        โ”‚
โ”‚               โ””โ”€โ”€ Quotas                                    โ”‚
โ”‚                    โ”œโ”€โ”€ QuotaName                            โ”‚
โ”‚                    โ”œโ”€โ”€ Limit                                โ”‚
โ”‚                    โ”œโ”€โ”€ Used                                 โ”‚
โ”‚                    โ”œโ”€โ”€ Available                            โ”‚
โ”‚                    โ”œโ”€โ”€ Unit                                 โ”‚
โ”‚                    โ””โ”€โ”€ Description                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2. Prerequisites

2.1 Common

  • The target CSP Connection must be registered and working correctly.

2.2 GCP

3. CB-Spider Quota API Specification

3.1 Quota API Endpoints

# List available service types for quota
GET /spider/quotaservicetype        - List Quota Service Types

# Get quota details for a specific service type
GET /spider/quotainfo               - Get Quota Info

3.2 Request Parameters

ListQuotaServiceType

Parameter Description Example
ConnectionName Name of the target Connection to query quota information aws-seoul-config, gcp-seoul-config

GetQuotaInfo

Parameter Description Example
ConnectionName Name of the target Connection to query quota information aws-seoul-config
ServiceType Service type name obtained from ListQuotaServiceType ec2, compute.googleapis.com, ecs

3.3 Response Schema

Quota Information (QuotaInfo)

Field Description Example
CSP Cloud provider name AWS, AZURE, GCP, ALIBABA
Region Region/location the quotas apply to ap-northeast-2, koreacentral, asia-northeast3, cn-beijing
Quotas List of quota details under the service type See Quota below

Quota Detail (Quota)

Field Description Example
QuotaName Quota item name Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances, CPUs
Limit Maximum allowed value 500, 24, 801
Used Currently consumed amount 12, 8, 26
Available Remaining capacity (Limit - Used) 488, 16, 775
Unit Unit of measurement count, vCPU, Count, NA
Description Additional quota information AWS QuotaArn, etc.

Note

  • If the CSP does not expose Used, Available, Unit, etc., those values are returned as NA.
  • Quota item names and descriptions are passed through from the CSP as-is.

4. CB-Spider Quota API Examples

4.1 List Service Types

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX 'GET' 'http://localhost:1024/spider/quotaservicetype?ConnectionName=aws-seoul-config' | jq

Response example:

{
  "ServiceTypes": [
    "ec2",
    "vpc",
    "ebs",
    ...
  ]
}

4.2 Get Quota Info for a Service Type

curl -u "$SPIDER_USERNAME:$SPIDER_PASSWORD" -sX 'GET' 'http://localhost:1024/spider/quotainfo?ConnectionName=aws-seoul-config&ServiceType=ec2' | jq

Response example:

{
  "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"
    }
  ]
}

5. Test Results

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

  • During testing, the following 4 service types returned errors because they are not supported in the current region.
  • This is an expected exception (see Caveats section for details).
    • ros
    • openapiexplorer
    • sas
    • cloudsso
============================================================
 Test Result Summary
============================================================
 Connection      : alibaba-beijing-config
 Service Types   : 66
 Success         : 62
 Failure         : 4
============================================================

6. Caveats and Constraints

6.1 Service Type Format Differs per CSP

  • AWS: ec2, vpc, ebs, eks, etc.
  • Azure: Compute, ContainerService, etc.
  • GCP: compute.googleapis.com, container.googleapis.com, etc.
  • Alibaba: ecs, csk, etc.

6.2 Alibaba Region-Specific Service Availability

  • The Alibaba service type list may include entries not supported in the current region.
    • There is no single API to retrieve only the service types available in the current region.
    • Filtering supported service types would require many individual GetQuota API calls.
  • Therefore, a GetQuotaInfo request for certain service types may return the following error:
    • ErrorCode: QUOTA.DIMENSION.VALUE.UNSUPPORT

6.3 Alibaba China Account Returns Quota Info in Chinese

  • When using an Alibaba China account, the QuotaName and Description fields returned by the Quota API are provided in Chinese.
  • This is presumed to be a CSP policy that cannot be overridden via API language options.
{
  "QuotaName": "ๅ•ๆฌกๅฏ่ดญไนฐ็š„ๅŒ…ๅนดๅŒ…ๆœˆๅฎžไพ‹็š„ๆœ€ๅคงๆ•ฐ้‡",
  "Limit": "300",
  "Used": "0",
  "Available": "300",
  "Unit": "NA",
  "Description": "ๅ•ๆฌกๅฏ่ดญไนฐ็š„ๅŒ…ๅนดๅŒ…ๆœˆecs็š„ๆœ€ๅคงๆ•ฐ้‡"
}

7. API Response Codes

HTTP Status Description
200 OK Request successful
400 Bad Request Invalid request (missing required parameter, invalid service type, etc.)
404 Not Found Target resource not found
500 Internal Server Error Internal server error or CSP API error

8. References

CSP Console โ€” Where to Check Quotas