API请求
URLs
PUT zstack/v1/model-service-instance-groups/{uuid}Headers
Authorization: OAuth the-session-uuidBody
{
"updateModelServiceInstanceGroup": {
"name": "example"
},
"systemTags": [],
"userTags": []
}上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateModelServiceInstanceGroup":{"name":"example"}}' http://localhost:8080/zstack/v1/model-service-instance-groups/ce3b18f23a1e32c083f49cc99484c9a7参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 5.1.8 | |
| name (可选) | String | body(包含在updateModelServiceInstanceGroup结构中) | 资源名称 | 5.1.8 | |
| description (可选) | String | body(包含在updateModelServiceInstanceGroup结构中) | 资源的详细描述 | 5.3.20 | |
| systemTags (可选) | List | body | 系统标签 | 5.1.8 | |
| userTags (可选) | List | body | 用户标签 | 5.1.8 | |
| environmentVariables (可选) | Map | body(包含在updateModelServiceInstanceGroup结构中) | 环境变量 | 5.3.22 | |
| startupParameters (可选) | Map | body(包含在updateModelServiceInstanceGroup结构中) | 启动参数 | 5.3.22 | |
| serviceLivez (可选) | String | body(包含在updateModelServiceInstanceGroup结构中) | 5.4.6 | ||
| serviceReadyz (可选) | String | body(包含在updateModelServiceInstanceGroup结构中) | 5.4.6 | ||
| serviceBootupTime (可选) | Integer | body(包含在updateModelServiceInstanceGroup结构中) | 5.4.6 | ||
| packageVersion (可选) | String | body(包含在updateModelServiceInstanceGroup结构中) | 5.5.6 |
API返回
返回示例
{
"inventory": {
"uuid": "groupUuid",
"name": "model-service-group",
"status": "Running"
}
}返回字段
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | Boolean | 操作是否成功 | 5.1.8 |
| error | ErrorCode | 错误码,操作成功时该字段为null | 5.1.8 |
| inventory | ModelServiceInstanceGroupInventory | 模型服务实例组清单 | 5.1.8 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标识该资源 | 5.1.8 |
| modelServiceUuid | String | 模型服务UUID | 5.1.8 |
| modelUuid | String | 模型UUID | 5.1.8 |
| instances | List | 模型服务实例列表 | 5.1.8 |
| datasetRefInventories | List | 数据集引用列表 | 5.1.8 |
| status | String | 实例组状态 | 5.1.8 |
| modelServiceType | String | 模型服务类型 | 5.1.8 |
| type | String | 实例组类型 | 5.1.8 |
| name | String | 实例组名称 | 5.1.8 |
| description | String | 实例组描述 | 5.1.8 |
| yaml | String | YAML配置 | 5.1.8 |
| supportMetrics | List | 支持的指标列表 | 5.1.8 |
| exportPath | String | 导出路径 | 5.1.8 |
| createDate | Timestamp | 创建时间 | 5.1.8 |
| lastOpDate | Timestamp | 最后一次修改时间 | 5.1.8 |
SDK示例
Java
SDK
UpdateModelServiceInstanceGroupAction action = new UpdateModelServiceInstanceGroupAction();
action.uuid = "ce3b18f23a1e32c083f49cc99484c9a7";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateModelServiceInstanceGroupAction.Result res = action.call();Python
SDK
UpdateModelServiceInstanceGroupAction action = UpdateModelServiceInstanceGroupAction()
action.uuid = "ce3b18f23a1e32c083f49cc99484c9a7"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateModelServiceInstanceGroupAction.Result res = action.call()