资讯 文档
技术能力
语音技术
文字识别
人脸与人体
图像技术
语言与知识
视频技术

查询算力单元详情

功能介绍

本接口用于查询指定算力单元详细信息。

权限说明

调用本文API,需符合以下权限要求,权限介绍及分配,请查看角色与权限控制列表账号创建与权限分配。需具有以下任一权限:

  • 完全控制千帆大模型平台的权限:QianfanFullControlAccessPolicy
  • 运维操作千帆大模型平台预测服务的权限:QianfanServiceOperateAccessPolicy
  • 只读访问千帆大模型平台预测服务的权限:QianfanServiceReadAccessPolicy

鉴权说明

调用本文API,使用“基于安全认证AK/SK”进行签名计算鉴权,即使用安全认证中的Access Key ID 和 Secret Access Key进行鉴权,具体鉴权认证机制参考HTTP调用鉴权说明

请求结构

POST /v2/computeunit?Action=DescribeComputeUnit HTTP/1.1
Host: qianfan.baidubce.com
Authorization: authorization string
Content-Type: application/json

{
   "instanceId":"unit-xxx"
}

请求头域

除公共头域外,无其它特殊头域。

请求参数

  • Query参数
名称 类型 必填 描述
Action string 方法名称,固定值DescribeComputeUnit
  • Body参数
名称 类型 必填 描述
instanceId string 实例ID,说明:该字段通过调用购买算力单元接口,返回的instanceId获取

响应头域

除公共头域外,无其它特殊头域。

响应参数

名称 类型 描述
requestId string 请求ID
result object 请求结果

result说明

名称 类型 描述
computeUnitInstance object 资源信息
serviceUsageList List<serviceInfo> 服务信息

computeUnitInstance说明

名称 类型 描述
instanceId string 实例ID
region string 资源地域,具体值如下:
· bj:北京
· bd:保定
· sz:苏州
· gz:广州
· yq:阳泉
· global:全局
status string 资源状态,具体值如下:
· Creating:创建中
· CreateFailed:创建失败
· Running:使用中
· Releasing:释放中
· Released:已释放
· Reconfiguring:变配中
· ReconfigureFailed:变配失败
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:年

serviceInfo说明

名称 类型 描述
serviceName string 服务名称
serviceId string 服务ID
runStatus string 服务状态,具体值如下:
· New:待发布
· Deploying:发布中
· Serving:已发布
· Failed:发布失败
· Deactivating:下线中
· DeactivationFailed:下线失败
scaleStatus string 扩缩容状态,具体值如下:
· ScalingIn:缩容中
· ScalingOut:扩容中
· ScalingFailed:扩缩容失败
deployedComputingUnits int 部署使用算力单元数,等于单副本算力单元数*部署副本数
creator string 创建人

请求示例

curl --location 'https://qianfan.baidubce.com/v2/computeunit?Action=DescribeComputeUnit' \
--header 'Authorization: bce-auth-v1/f0ee7a166xxxxa8079702c13/2023-09-19T13:42:13Z/180000/host;x-bce-date/9a8cfb8ee58a8xxxxxxxe374525543' \
--header 'Content-Type: application/json' \
--data '{
    "instanceId":"unit-xxx"
}'

响应示例

{
    "requestId":"1bef3f87-c5b2-4419-936b-50f9884f10d4",
    "result": {
        "computeUnitInstance": {
            "instanceId": "unit-xxx",
            "region": "bj",
            "status": "Running",
            "type": "gpu-1",
            "totalComputeUnits": 4,
            "usedComputeUnits": 2,
            "paymentTiming": "Prepaid",
            "startTime": "2024-12-03T06:24:03Z",
            "expiredTime": "2025-01-03T06:24:03Z",
            "reservationLength": 1,
            "reservationTimeUnit": "MONTH",
            "creator": "xxx",
            "autoRenew": {
                "renewTime": 4,
                "renewTimeUnit": "month"
            }
        },
        "serviceInfoList": [
            {
                "serviceName": "xxxx",
                "serviceId": "svco-xxxx",
                "runStatus": "Serving",
                "deployedComputingUnits": 1,
                "creator": "xxxx"
            }
        ]
    }
}

错误码

若请求错误,服务器将返回的JSON文本包含以下参数:

名称 描述
requestId 请求ID
code 错误码
message 错误描述信息,帮助理解和解决发生的错误

例如错误返回:

{
    "requestId":"6ba7b810-xxxc04fd430c8",
    "code":"AccessDenied",
    "message":"Access denied."
}

更多其他错误码,也可以查看错误码说明

上一篇
查询算力单元列表
下一篇
算力单元变配