API请求
URLs
PUT zstack/v1/ai/model-centers/{uuid}Headers
Authorization: OAuth the-session-uuidBody
{
"updateModelCenter": {
"name": "example"
},
"systemTags": [],
"userTags": []
}说明: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateModelCenter":{"name":"example"}}' http://localhost:8080/zstack/v1/ai/model-centers/54ad208f641036aab2bcd410c7f2bb84参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 5.1.8 | |
| name (可选) | String | body(包含在updateModelCenter结构中) | 资源名称 | 5.1.8 | |
| url (可选) | String | body(包含在updateModelCenter结构中) | 模型存储的url | 5.1.8 | |
| description (可选) | String | body(包含在updateModelCenter结构中) | 资源的详细描述 | 5.1.8 | |
| parameters (可选) | String | body(包含在updateModelCenter结构中) | 模型中心的详细参数 | 5.1.8 | |
| systemTags (可选) | List | body | 系统标签 | 5.1.8 | |
| userTags (可选) | List | body | 用户标签 | 5.1.8 | |
| managementIp (可选) | String | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| managementPort (可选) | Integer | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| storageNetworkUuid (可选) | String | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| serviceNetworkUuid (可选) | String | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| containerRegistry (可选) | String | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| containerNetwork (可选) | String | body(包含在updateModelCenter结构中) | 5.1.8 | ||
| containerStorageNetwork (可选) | String | body(包含在updateModelCenter结构中) | 5.1.20 |
API返回
返回示例
{
"inventory": {
"uuid": "42fe9ce3318f44c686b398947411c85c",
"name": "example",
"description": "modelCenter",
"url": "http://modelCenter",
"parameters": "parameters",
"managementIp": "172.24.0.23",
"managementPort": 5000
}
}#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 5.1.8 |
| description | String | 错误的概要描述 | 5.1.8 |
| details | String | 错误的详细信息 | 5.1.8 |
| elaboration | String | 保留字段,默认为null | 5.1.8 |
| opaque | LinkedHashMap | 保留字段,默认为null | 5.1.8 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 5.1.8 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标识该资源 | 5.1.8 |
| name | String | 资源名称 | 5.1.8 |
| description | String | 资源的详细描述 | 5.1.8 |
| url | String | 模型中心URL | 5.1.8 |
| status | String | 模型中心状态 | 5.1.8 |
| parameters | String | 模型中心参数 | 5.1.8 |
| managementIp | String | 管理IP地址 | 5.1.8 |
| managementPort | Integer | 管理端口 | 5.1.8 |
| storageNetworkUuid | String | 存储网络UUID | 5.1.8 |
| serviceNetworkUuid | String | 服务网络UUID | 5.1.8 |
| containerRegistry | String | 容器镜像仓库地址 | 5.1.8 |
| containerStorageNetwork | String | 容器存储网络 | 5.1.8 |
| containerNetwork | String | 容器网络 | 5.1.8 |
| capacity | ModelCenterCapacityInventory | 模型中心容量信息 | 5.1.8 |
| zdfs | ZdfsInventory | ZDFS信息 | 5.1.8 |
| createDate | Timestamp | 创建时间 | 5.1.8 |
| lastOpDate | Timestamp | 最后一次修改时间 | 5.1.8 |
SDK示例
Java
SDK
UpdateModelCenterAction action = new UpdateModelCenterAction();
action.uuid = "54ad208f641036aab2bcd410c7f2bb84";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateModelCenterAction.Result res = action.call();Python SDK
UpdateModelCenterAction action = UpdateModelCenterAction()
action.uuid = "54ad208f641036aab2bcd410c7f2bb84"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateModelCenterAction.Result res = action.call()