查询日用量公测版
本接口查询指定组织指定时间段的日用量。当前用户须为组织所有者或计费管理员。
POST
/v2/usage/query该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com.cn
📘说明
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
当前接口为公测版。如果您在使用该接口过程中遇到任何问题,欢迎您联系 Zilliz Cloud 技术支持。
export BASE_URL="https://api.cloud.zilliz.com.cn"
参数
Authorizationstringheaderrequired
认证令牌,应为具备适当权限的 API 密钥。
示例值:Bearer {{TOKEN}}
请求体application/json
startstring
查询时间段开始日期,格式为 YYYY-MM-DD
。
endstring
查询时间段结束日期,格式为 YYYY-MM-DD
。
export TOKEN="YOUR_API_KEY"
curl --request POST \
--url "${BASE_URL}/v2/usage/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"start": "2024-01-01T00:00:00Z",
"end": "2024-02-01T00:00:00Z"
}'
响应200 - application/json
Returns the detailed daily usage of the organization in the specified time period.
codeinteger
响应码。
dataobject
resultsarray
[]resultsobject
intervalStartstring
查询时间段开始时间,格式为 YYYY-MM-DDTHH:mm:ssZ
。
intervalEndstring
查询时间段结束时间,格式为 YYYY-MM-DDTHH:mm:ssZ
。
totalnumber
指定时间段内的用量总金额。
currencystring
总金额币种。
itemsarray
指定时间段内的用量明细。
[]itemsobject
costTypestring
费用类型。
propertiesobject
当前费用项详情。
projectIdstring
产生当前费用项目的集群所属项目 ID。
regionIdstring
产生当前费用项目的集群所属区域 ID。
cuTypestring
产生当前费用项目的集群的 CU 类型。
planstring
产生当前费用项目的集群的订阅计划。
clusterIdstring
产生当前费用项目的集群 ID。
quantitynumber
当前费用项对应的已使用的资源数量。
unitstring
当前费用项对应的已使用的资源数量单位。
listPriceobject
当前费用项对应的已使用的资源列表价格。
unitPricenumber
资源单价。
priceobject
当前费用项对应的已使用的资源实际价格。
unitPricenumber
资源单价。
amountnumber
当前费用项对应的已使用的资源实际费用。
currentPageinteger
查询结果当前页码。
取值范围:≥ 1
pageSizeinteger
查询结果每页显示条目数。
取值范围:≥ 1≤ 100
totalinteger
查询结果总条目数。
Returns an error message.
codeinteger
响应码。
messagestring
错误描述。
{
"code": 0,
"data": {
"results": [
{
"intervalStart": "2024-01-01T00:00:00Z",
"intervalEnd": "2024-01-02T00:00:00Z",
"total": 12345.12345678,
"currency": "USD",
"items": [
{
"costType": "compute",
"properties": {
"projectId": "prj-12jhiu212748391",
"regionId": "aws-us-west-2",
"cuType": "Performance-optimized",
"plan": "Standard",
"clusterId": "in01-xxxxx"
},
"quantity": 55.6778,
"unit": "CU-hours",
"listPrice": {
"unitPrice": 123
},
"price": {
"unitPrice": 123
},
"amount": 12345.12345678
},
{
"costType": "storage",
"properties": {
"projectId": "prj-12jhiu212748391",
"regionId": "aws-us-west-2",
"cuType": "Performance-optimized",
"plan": "Standard",
"clusterId": "in01-xxxxx"
},
"quantity": 55.6778,
"unit": "...",
"amount": 12345.12345678
},
{
"costType": "read_vcu",
"properties": {
"projectId": "prj-12jhiu212748391",
"regionId": "aws-us-west-2",
"clusterId": "in01-xxxxx"
},
"quantity": 8123789132,
"unit": "...",
"amount": 12345.12345678,
"listPrice": {
"unitPrice": 123
},
"price": {
"unitPrice": 123
}
}
]
}
],
"currentPage": 1,
"pageSize": 100,
"total": 10000
}
}