API请求
URLs
GET zstack/v1/ai/model-servicesGET zstack/v1/ai/model-services/{uuid}Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ai/model-servicescurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ai/model-services/2a7294d3217d35c196b39e2f43d6bbd7可查询字段
运行zstack-cli命令行工具,输入QueryModelService并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"name": "text to text model service",
"description": "This is text to text model service you can chose model",
"yaml": "model service parameters",
"requestCpu": 4,
"requestMemory": 1024,
"supportDistributed": false
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 5.2.1 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 5.2.1 |
| inventories | List | 详情参考inventories | 5.2.1 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 5.2.1 |
| description | String | 错误的概要描述 | 5.2.1 |
| details | String | 错误的详细信息 | 5.2.1 |
| elaboration | String | 保留字段,默认为null | 5.2.1 |
| opaque | LinkedHashMap | 保留字段,默认为null | 5.2.1 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 5.2.1 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标识该资源 | 5.1.8 |
| name | String | 资源名称 | 5.1.8 |
| description | String | 资源的详细描述 | 5.1.8 |
| readme | String | README内容 | 5.1.8 |
| yaml | String | 服务YAML配置 | 5.1.8 |
| requestCpu | Integer | 请求CPU数量 | 5.1.8 |
| requestMemory | Long | 请求内存大小 | 5.1.8 |
| modelCenterUuid | String | 模型中心UUID | 5.1.8 |
| type | String | 模型服务类型 | 5.1.8 |
| framework | String | 模型服务框架 | 5.1.8 |
| source | String | 模型服务来源 | 5.1.8 |
| size | Long | 模型服务大小 | 5.1.8 |
| system | Boolean | 是否为系统模型服务 | 5.1.8 |
| hasNewVersion | Boolean | 是否存在新版本 | 5.1.8 |
| gpuComputeCapability | String | GPU算力要求 | 5.1.8 |
| installPath | String | 模型服务安装路径 | 5.1.8 |
| pythonVersion | String | Python版本 | 5.1.8 |
| condaVersion | String | Conda版本 | 5.1.8 |
| version | String | 模型服务版本 | 5.1.8 |
| startCommand | String | 启动命令 | 5.1.8 |
| containerCommand | String | 容器启动命令 | 5.1.8 |
| containerArgs | String | 容器启动参数 | 5.1.8 |
| supportDistributed | Boolean | 是否支持分布式部署 | 5.1.8 |
| cpuArchitectures | List | 支持的CPU架构 | 5.1.8 |
| vendorToSpecUuidsMap | Map | GPU厂商与规格UUID映射 | 5.1.8 |
| modelServiceRefs | List | 模型与模型服务的绑定关系 | 5.1.8 |
| modelServiceImages | List | 模型服务镜像列表 | 5.1.8 |
| createDate | Timestamp | 创建时间 | 5.1.8 |
| lastOpDate | Timestamp | 最后一次修改时间 | 5.1.8 |
SDK示例
Java
SDK
QueryModelServiceAction action = new QueryModelServiceAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryModelServiceAction.Result res = action.call();Python SDK
QueryModelServiceAction action = QueryModelServiceAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryModelServiceAction.Result res = action.call()