-
Notifications
You must be signed in to change notification settings - Fork 0
镜像模块API
xiaoqiangcoding edited this page Feb 15, 2017
·
3 revisions
请求类型: POST
请求URL: /v1.0/admin/admin_create_image
URL路径参数:
名称 | 字段类型 | 说明 |
---|---|---|
token | String | 超级管理员认证token |
request | string | 镜像的相关信息 |
myfile | file | 镜像的数据信息 |
返回数据:返回数据为204的状态码
说明:request的json请求格式如下
{
"container_format": "bare",
"name": "Ubuntu",
"disk_format":"qcow2",
"min_disk" :0,
"min_ram":0,
"protected":true,
"visibility" :"private"
}
file的字段应该以'qcow2', 'ami', 'ari', 'aki', 'vhd', 'vhdx', 'vmdk', 'raw', 'vdi', 'iso' 结尾的文件
请求类型: POST
请求URL: /v1.0/admin/admin_update/image/<image_id>
URL路径参数:
名称 | 字段类型 | 说明 |
---|---|---|
token | String | 超级管理员认证token |
image_id | string | 镜像更新的ID |
request | string | 更新的信息 |
说明:request的json请求格式如下
[
{
"op":"replace",
"path":"/name",
"value":"11"
},
{
"op": "replace",
"path": "/min_disk",
"value":2
},
{
"op": "replace",
"path": "/min_ram",
"value":1
},
{
"op": "replace",
"path": "/protected",
"value":true
},
{
"op": "replace",
"path": "/visibility",
"value": "public"
}
]
返回字段为以下:
{
"status": "active",
"name": "11",
"tags": [],
"container_format": "bare",
"created_at": "2017-02-15T03:03:37Z",
"size": 49,
"disk_format": "qcow2",
"updated_at": "2017-02-15T05:34:49Z",
"visibility": "public",
"self": "/v2/images/b5e584b9-e29a-4d8e-9e1f-83b5b1d45811",
"min_disk": 2,
"protected": true,
"id": "b5e584b9-e29a-4d8e-9e1f-83b5b1d45811",
"file": "/v2/images/b5e584b9-e29a-4d8e-9e1f-83b5b1d45811/file",
"checksum": "f873469705ccfab9f9fbf4c279f07b30",
"owner": "5d03fc15631048d19bedaf1f911568e8",
"virtual_size": null,
"min_ram": 1,
"schema": "/v2/schemas/image"
}
请求类型: POST
请求URL: /v1.0/admin/admin_update/image/<image_id>
URL路径参数:
名称 | 字段类型 | 说明 |
---|---|---|
token | String | 超级管理员认证token |
image_id | string | 镜像更新的ID |
request | string | 更新的信息 |
说明:request的json请求格式如下
[
{
"op":"replace",
"path":"/name",
"value":"11"
},
{
"op": "replace",
"path": "/min_disk",
"value":2
},
{
"op": "replace",
"path": "/min_ram",
"value":1
},
{
"op": "replace",
"path": "/protected",
"value":true
},
{
"op": "replace",
"path": "/visibility",
"value": "public"
}
]
请求类型: POST
请求URL: /v1.0/admin/admin_delete/image
URL路径参数:
名称 | 字段类型 | 说明 |
---|---|---|
token | String | 超级管理员认证token |
| request | string| 更新的信息|
说明:request的json请求格式如下
{"images_ids": ["bb22be0d-5a03-43c2-92fb-d4f858178d63"]}
返回值为以下:
{"bb22be0d-5a03-43c2-92fb-d4f858178d63": 204}