Skip to Content
GPU 接口文档团队管理查询成员产品类型列表
GPU API 接口

查询成员产品类型列表

接口说明

查询指定团队成员拥有的产品类型列表,可用于订单筛选条件。

POSThttps://api.compshare.cnActionListMemberProductType

使用限制

  • 账户需完成实名认证。
  • 需要团队管理员权限。

请求参数

名称类型必填描述示例值
ActionString接口名称ListMemberProductType
RegionString地域cn-wlcb
TeamIdUint32团队 ID100001
VirtualCompanyIdUint32成员虚拟账户 ID300001
BeginTimeInt64起始时间(Unix 时间戳)1700000000
EndTimeInt64结束时间(Unix 时间戳)1700086400
OrderStatesArray of String订单状态筛选数组["OS_FINISHED"]

响应参数

名称类型描述示例值
ActionString响应名称ListMemberProductTypeResponse
RetCodeInteger返回码,0 为成功0
ProductTypeListArray<String>产品类型列表["GPU算力","云硬盘"]

请求示例

Python(使用 UCloud SDK)

安装 SDK:

pip install --upgrade ucloud-sdk-python3

示例代码:

from ucloud.core import exc from ucloud.client import Client def main(): client = Client({ "region": "cn-wlcb", "public_key": "my_public_key", # 替换为你的公钥(控制台 账户中心 → API 密钥:https://console.compshare.cn/uaccount/api_manage) "private_key": "my_private_key", # 替换为你的私钥 "base_url": "https://api.compshare.cn", }) try: resp = client.ucompshare().list_member_product_type({ "TeamId": 100001, "VirtualCompanyId": 300001, }) print(f"产品类型: {resp['ProductTypeList']}") except exc.UCloudException as e: print(e) if __name__ == "__main__": main()

Go(使用 UCloud SDK)

安装依赖:

go get github.com/ucloud/ucloud-sdk-go

示例代码:

package main import ( "fmt" "github.com/ucloud/ucloud-sdk-go/services/ucompshare" "github.com/ucloud/ucloud-sdk-go/ucloud" "github.com/ucloud/ucloud-sdk-go/ucloud/auth" ) func main() { cfg := ucloud.NewConfig() cfg.Region = "cn-wlcb" cfg.BaseUrl = "https://api.compshare.cn" credential := auth.NewCredential() credential.PublicKey = "my_public_key" // 替换为你的公钥(控制台 账户中心 → API 密钥:https://console.compshare.cn/uaccount/api_manage) credential.PrivateKey = "my_private_key" // 替换为你的私钥 client := ucompshare.NewClient(&cfg, &credential) req := client.NewListMemberProductTypeRequest() req.TeamId = ucloud.Uint32(100001) req.VirtualCompanyId = ucloud.Uint32(300001) resp, err := client.ListMemberProductType(req) if err != nil { fmt.Printf("查询失败: %s\n", err) return } fmt.Printf("产品类型: %v\n", resp.ProductTypeList) }

响应示例

{ "Action": "ListMemberProductTypeResponse", "RetCode": 0, "ProductTypeList": [ "GPU算力", "云硬盘", "弹性IP" ] }
Last updated on