资源池相关
更新时间:2025-01-24
资源池列表
使用以下代码可以列出资源池
// import "github.com/baidubce/bce-sdk-go/services/aihc"
// import "github.com/baidubce/bce-sdk-go/services/aihc/api/v1"
ak, sk, endpoint := "Your ak", "Your sk", "aihc.bj.baidubce.com"
client, _ := aihc.NewClient(ak, sk, endpoint)
result, err := client.ListResourcePool(&v1.ListResourcePoolRequest{
PageNo: 2,
PageSize: 2,
})
if err != nil {
panic(err)
}
注意:
- 根据接口文档去填写具体的访问参数,接口链接为资源池列表
资源池详情
使用以下代码可以获取资源池详情
// import "github.com/baidubce/bce-sdk-go/services/aihc"
// import "github.com/baidubce/bce-sdk-go/services/aihc/api/v1"
ak, sk, endpoint := "Your ak", "Your sk", "aihc.bj.baidubce.com"
resourcePoolID := "xxxxx"
client, _ := aihc.NewClient(ak, sk, endpoint)
result, err := client.GetResourcePool(resourcePoolID)
if err != nil {
panic(err)
}
注意:
- 根据接口文档去填写具体的访问参数,接口链接为资源池详情
资源池节点列表
使用以下代码可以获取资源池节点列表
// import "github.com/baidubce/bce-sdk-go/services/aihc"
// import "github.com/baidubce/bce-sdk-go/services/aihc/api/v1"
ak, sk, endpoint := "Your ak", "Your sk", "aihc.bj.baidubce.com"
resourcePoolID := "xxxxx"
client, _ := aihc.NewClient(ak, sk, endpoint)
result, err := client.ListNodeByResourcePoolID(resourcePoolID, &v1.ListResourcePoolNodeRequest{
PageNo: 1,
PageSize: 2,
})
if err != nil {
panic(err)
}
注意:
- 根据接口文档去填写具体的访问参数,接口链接为资源池节点列表
队列列表
使用以下代码可以获取资源池队列列表
// import "github.com/baidubce/bce-sdk-go/services/aihc"
// import "github.com/baidubce/bce-sdk-go/services/aihc/api/v1"
ak, sk, endpoint := "Your ak", "Your sk", "aihc.bj.baidubce.com"
resourcePoolID := "xxxxx"
client, _ := aihc.NewClient(ak, sk, endpoint)
result, err := client.ListQueue(resourcePoolID, &v1.ListQueueRequest{
PageNo: 1,
PageSize: 2,
})
if err != nil {
panic(err)
}
注意:
- 根据接口文档去填写具体的访问参数,接口链接为队列列表
队列详情
使用以下代码可以获取资源池节点列表
// import "github.com/baidubce/bce-sdk-go/services/aihc"
// import "github.com/baidubce/bce-sdk-go/services/aihc/api/v1"
ak, sk, endpoint := "Your ak", "Your sk", "aihc.bj.baidubce.com"
resourcePoolID, queueName := "xxxxx", "xxxxx"
client, _ := aihc.NewClient(ak, sk, endpoint)
result, err := client.GetQueue(resourcePoolID, queueName)
if err != nil {
panic(err)
}
注意:
- 根据接口文档去填写具体的访问参数,接口链接为队列详情