查询算力单元详情
更新时间:2025-05-13
功能介绍
本接口用于查询指定算力单元详细信息。
权限说明
调用本文API,需符合以下权限要求,权限介绍及分配,请查看角色与权限控制列表、账号创建与权限分配。需具有以下任一权限:
- 完全控制千帆大模型平台的权限:QianfanFullControlAccessPolicy
- 运维操作千帆大模型平台预测服务的权限:QianfanServiceOperateAccessPolicy
- 只读访问千帆大模型平台预测服务的权限:QianfanServiceReadAccessPolicy
鉴权说明
调用本文API,使用“基于安全认证AK/SK”进行签名计算鉴权,即使用安全认证中的Access Key ID 和 Secret Access Key进行鉴权,具体鉴权认证机制参考HTTP调用鉴权说明。
请求结构
Bash
1POST /v2/computeunit?Action=DescribeComputeUnit HTTP/1.1
2Host: qianfan.baidubce.com
3Authorization: authorization string
4Content-Type: application/json
5
6{
7 "instanceId":"unit-xxx"
8}
请求头域
除公共头域外,无其它特殊头域。
请求参数
- Query参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
Action | string | 是 | 方法名称,固定值DescribeComputeUnit |
- Body参数
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
instanceId | string | 是 | 实例ID,说明:该字段通过调用购买算力单元接口,返回的instanceId获取 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
名称 | 类型 | 描述 |
---|---|---|
requestId | string | 请求ID |
result | object | 请求结果 |
result说明
名称 | 类型 | 描述 |
---|---|---|
computeUnitInstance | object | 资源信息 |
serviceUsageList | List<object> | 服务信息 |
computeUnitInstance说明
名称 | 类型 | 描述 |
---|---|---|
instanceId | string | 实例ID |
region | string | 资源地域,具体值如下: · bj:北京 · bd:保定 · sz:苏州 · gz:广州 · yq:阳泉 · global:全局 |
status | string | 资源状态,具体值如下: · Creating:创建中 · CreateFailed:创建失败 · Running:使用中 · Releasing:释放中 · Released:已释放 · Reconfiguring:变配中 · ReconfigureFailed:变配失败 · BillingChanging:计费变更中 |
type | string | 资源类型,具体值如下: · CPU:cpu · 加速卡I型:gpu-1 · 加速卡Ⅱ型:gpu-2 · 加速卡Ⅲ型:gpu-3 · 加速卡Ⅳ型:gpu-4 · 加速卡Ⅴ型:gpu-5 · 加速卡Ⅵ型:gpu-6 |
totalComputeUnits | int | 算力单元总数 |
usedComputeUnits | int | 已用算力单元数 |
paymentTiming | string | 资源付费类型,具体值如下: · Prepaid:预付费 · Postpaid:后付费 |
startTime | string | 算力单元实例的开始时间 |
expiredTime | string | 算力单元实例的到期时间 |
releaseTime | string | 自动释放时间,说明:当资源付费类型为后付费且有设置自动释放时间时,返回该字段 |
reservationLength | int | 实例时长,说明:当资源付费类型为预付费,即paymentTiming=Prepaid时,返回该字段 |
reservationTimeUnit | string | 实例时长单位,说明:当资源付费类型为预付费,即paymentTiming=Prepaid时,返回该字段 |
creator | string | 资源创建人 |
autoRenew | object | 自动续费设置信息,说明:当资源付费类型为预付费且有设置自动续费规则时,返回该字段 |
autoRenew说明
名称 | 类型 | 描述 |
---|---|---|
renewTime | int | 续费时长 |
renewTimeUnit | string | 续费时长单位,具体值如下: · MONTH:月 · YEAR:年 |
serviceUsageList说明
名称 | 类型 | 描述 |
---|---|---|
serviceName | string | 服务名称 |
serviceId | string | 服务ID |
runStatus | string | 服务状态,具体值如下: · New:待发布 · Deploying:发布中 · Serving:已发布 · Failed:发布失败 · Deactivating:下线中 · DeactivationFailed:下线失败 |
scaleStatus | string | 扩缩容状态,具体值如下: · ScalingIn:缩容中 · ScalingOut:扩容中 · ScalingFailed:扩缩容失败 |
deployedComputingUnits | int | 部署使用算力单元数,等于单副本算力单元数*部署副本数 |
creator | string | 创建人 |
请求示例
bash
1curl --location 'https://qianfan.baidubce.com/v2/computeunit?Action=DescribeComputeUnit' \
2--header 'Authorization: bce-auth-v1/f0ee7a166xxxxa8079702c13/2023-09-19T13:42:13Z/180000/host;x-bce-date/9a8cfb8ee58a8xxxxxxxe374525543' \
3--header 'Content-Type: application/json' \
4--data '{
5 "instanceId":"unit-xxx"
6}'
响应示例
JSON
1{
2 "requestId":"1bef3f87-c5b2-4419-936b-50f9884f10d4",
3 "result": {
4 "computeUnitInstance": {
5 "instanceId": "unit-xxx",
6 "region": "bj",
7 "status": "Running",
8 "type": "gpu-1",
9 "totalComputeUnits": 4,
10 "usedComputeUnits": 2,
11 "paymentTiming": "Prepaid",
12 "startTime": "2024-12-03T06:24:03Z",
13 "expiredTime": "2025-01-03T06:24:03Z",
14 "reservationLength": 1,
15 "reservationTimeUnit": "MONTH",
16 "creator": "xxx",
17 "autoRenew": {
18 "renewTime": 4,
19 "renewTimeUnit": "month"
20 }
21 },
22 "serviceInfoList": [
23 {
24 "serviceName": "xxxx",
25 "serviceId": "svco-xxxx",
26 "runStatus": "Serving",
27 "deployedComputingUnits": 1,
28 "creator": "xxxx"
29 }
30 ]
31 }
32}
错误码
若请求错误,服务器将返回的JSON文本包含以下参数:
名称 | 描述 |
---|---|
requestId | 请求ID |
code | 错误码 |
message | 错误描述信息,帮助理解和解决发生的错误 |
例如错误返回:
Plain Text
1{
2 "requestId":"6ba7b810-xxxc04fd430c8",
3 "code":"AccessDenied",
4 "message":"Access denied."
5}
更多其他错误码,也可以查看错误码说明。