查询ECS虚拟机容量
功能
查询ECS-VM即(含管理区、租户区)下已发放不同型号规格的虚拟机的已分配量、可用量。
|
SLA项 |
定义 |
|---|---|
|
请求成功率 |
≥99% |
|
可用性 |
Tier 2 |
|
数据一致性 |
强一致 |
|
吞吐量 |
60 次/分钟 |
|
TP50请求时延 |
200 ms |
|
TP99.9请求时延 |
300 ms |
注意事项
无
调用方法
GET
URI
/rest/dataapi/homs/open-api/v1/CloudService/capacity
路径参数
无
查询参数
无
请求
- 请求header参数
参数
是否必选
类型
值域
说明
X-APIG-Appcode
是
string
无
由SRE分配的AppCode。
x-auth-token
是
string
无
调用方APIG的IAM认证token。
x-hcso-domainid
是(HCSO场景)
否(其他场景)
string
无
接入的租户ID。
x-hcso-appcode
是
string
无
由SRE分配的AppCode
- 查询参数
参数
是否必选
类型
值域
说明
begin_time
是
int
无
查询开始时间(毫秒时间戳)。
end_time
是
int
无
查询结束时间(毫秒时间戳)。
service_type
否
string
ECS_VM
服务类型。
zone_type
否
string
manage/pod
manage管理区,pod租户区。
page_size
是
int
0~1000
页大小。
offset_value
是
int
无
查询起始值。
- 请求body参数
无
- 请求示例
GET /rest/dataapi/homs/open-api/v1/CloudService/capacity?service_type=ECS_VM HTTP/1.1 Host: example.com Content-Type: application/json Accept: application/json X-APIG-Appcode: xxx x-auth-token: xxx x-hcso-domainid:xxx x-hcso-appcode:xxx
响应
- 响应参数
参数
类型
值域
说明
resource_type
string
无
资源类型。
available
String
无
剩余可发放量,xx台(单位)。
az_name
string
无
可用区域。
used
Float64
无
已使用量。
used_ratio
Float64
无
使用率。
az_id
string
无
可用区域ID。
service_type
String
无
云服务名,标识资源所属的云服务。ecs-vm为ECS发放的虚拟机。
total
Integer
无
数据条数。
az_name_en
string
无
可用区域英文名称。
metric_type
String
无
虚拟机规格型号指标:如C6-2型号。
zone_type
String
无
资源所属区域类型:MANAGE管理区,POD或KVM_POD租户区。
free
Float64
无
剩余量。
region
String
无
资源所属region中文名。
resource_count
Float64
无
资源总量。
allocated
String
无
已分配发放量,xx台(单位)。
timestamp
Long
无
时间戳。
- 响应示例
HTTP/1.1 200 OK Date:Tue,18 Jul 2023 09:58:01 GMT Server: example.com Content-Type: application/json;charset=UTF8 { "total":33, "list":[ { "resource_type": "", "available": "13.06640625", "az_name": "可用区1", "used": "74.2802734375", "used_ratio": "0.40409390589222816", "az_id": "cn-north-213a", "service_type": "ecs-vm", "total": "238.96484375", "az_name_en": "AZ1", "metric_type": "xxx/C6规格", "zone_type": "MANAGE", "free": "109.5390625", "region": "cn-north-213", "resource_count": "1690", "allocated": "225.8984375", "timestamp": "1756742400000" } ] }
状态码
|
状态码 |
说明 |
|---|---|
|
200 |
操作成功。 |
|
400 |
参数错误。 |
|
401 |
token鉴权失败。 |
|
403 |
鉴权失败。 |
|
404 |
rest接口未找到。 |
|
500 |
默认ServiceException异常码,应用内部错误。 |