POST zstack/v1/images
Authorization: OAuth the-session-uuid
{
"params": {
"name": "TinyLinux",
"url": "http://192.168.1.20/share/images/tinylinux.qcow2",
"mediaType": "RootVolumeTemplate",
"architecture": "x86_64",
"system": false,
"format": "qcow2",
"platform": "Linux",
"backupStorageUuids": [
"b8fc9c1c027438c28d36af24eca06595"
],
"virtio": false
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d'{"params":{"name":"TinyLinux","url":"http://192.168.1.20/share/images/tinylinux.qcow2","mediaType":"RootVolumeTemplate","architecture":"x86_64","system":false,"format":"qcow2","platform":"Linux","backupStorageUuids":["b8fc9c1c027438c28d36af24eca06595"],"virtio":false}}' http://localhost:8080/zstack/v1/images
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
name | String | body (contained in the params structure) | The image name. | 0.6 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the image. | 0.6 | |
url | String | body (contained in the params structure) | The URL of the image to be added. | 0.6 | |
mediaType | String | body (contained in the params structure) | Optional. The image type. |
| 0.6 |
guestOsType | String | body (contained in the params structure) | Optional. The operating system type of the guest VM instance that corresponds to the image. | 0.6 | |
system | boolean | body (contained in the params structure) | Optional. Whether the image is a system image, for example, vRouter image. | 0.6 | |
format | String | body (contained in the params structure) | Optional. The image format, for example, raw. | 0.6 | |
platform | String | body (contained in the params structure) | Optional. The system platform of the image. |
| 0.6 |
backupStorageUuids | List | body (contained in the params structure) | The UUID list of the backup storages on which the image is to be added. | 0.6 | |
type | String | body (contained in the params structure) | Optional. The reserved field for internal use. | 0.6 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. If specified, the image will use the specified value as UUID. | 0.6 | |
architecture | String | body (contained in the params structure) | Optional. |
| 4.0.0 |
tagUuids | List | body (contained in the params structure) | Optional. The tag UUIDs. | 4.0.0 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
{
"inventory": {
"uuid": "1eb26d06364036b7860d2b7dbb462b8c",
"name": "TinyLinux",
"url": "http://192.168.1.20/share/images/tinylinux.qcow2",
"mediaType": "RootVolumeTemplate",
"platform": "Linux",
"architecture": "x86_64",
"format": "qcow2",
"backupStorageRefs": [
{
"id": 0.0,
"imageUuid": "1eb26d06364036b7860d2b7dbb462b8c",
"backupStorageUuid": "902dcc8d1015318fb4903df890765c4d",
"installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd",
"status": "Ready"
}
]
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | ImageInventory | See inventory. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
name | String | The resource name. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
state | String | 0.6 | |
status | String | 0.6 | |
size | Long | 0.6 | |
actualSize | Long | 0.6 | |
md5Sum | String | 0.6 | |
url | String | 0.6 | |
mediaType | String | 0.6 | |
guestOsType | String | 0.6 | |
type | String | 0.6 | |
platform | String | 0.6 | |
format | String | 0.6 | |
system | Boolean | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
backupStorageRefs | List | See backupStorageRefs. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
imageUuid | String | The image UUID. | 0.6 |
backupStorageUuid | String | The backup storage UUID. | 0.6 |
installPath | String | 0.6 | |
exportUrl | String | 0.6 | |
exportMd5Sum | String | 0.6 | |
status | String | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
AddImageAction action = new AddImageAction();
action.name = "TinyLinux";
action.url = "http://192.168.1.20/share/images/tinylinux.qcow2";
action.mediaType = "RootVolumeTemplate";
action.architecture = "x86_64";
action.system = false;
action.format = "qcow2";
action.platform = "Linux";
action.backupStorageUuids = asList("b8fc9c1c027438c28d36af24eca06595");
action.virtio = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddImageAction.Result res = action.call();
AddImageAction action = AddImageAction()
action.name = "TinyLinux"
action.url = "http://192.168.1.20/share/images/tinylinux.qcow2"
action.mediaType = "RootVolumeTemplate"
action.architecture = "x86_64"
action.system = false
action.format = "qcow2"
action.platform = "Linux"
action.backupStorageUuids = [b8fc9c1c027438c28d36af24eca06595]
action.virtio = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddImageAction.Result res = action.call()
DELETE zstack/v1/images/{uuid}?backupStorageUuids={backupStorageUuids}&deleteMode={deleteMode}
Authorization: OAuth the-session-uuid
{
"params": {
"backupStorageUuids": [
"2499cd48fc33450a8737efff67ccb920"
],
"deleteMode": "Permissive"
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth fb8be86094544022ad3e3abd0027b420" \
-X DELETE http://localhost:8080/zstack/v1/images/f92e888c970c4f739d91e59f6dd94b1e?backupStorageUuids=b5a48099da3e3423a8e41bf25b073ce0&deleteMode=Permissive
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The image UUID. | 0.6 | |
backupStorageUuids | List | body | Optional. The backup storage UUID list. | 0.6 | |
deleteMode | String | body | Optional. The delete mode. Options: Permissive | Enforcing. Default mode: Permissive. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
DeleteImageAction action = new DeleteImageAction();
action.uuid = "22850dff70934ffdaa839a950cb5a470";
action.backupStorageUuids = asList("32974c8955cd4ed79d13458e41490883");
action.deleteMode = "Permissive";
action.sessionId = "517a458b87ca49cf80bf26e6000bc611";
DeleteImageAction.Result res = action.call();
DeleteImageAction action = DeleteImageAction()
action.uuid = "5bbd892e048b48b283e5d2f49a6a4e94"
action.backupStorageUuids = [fd127191bf504e3daf5292800c1ea2d8]
action.deleteMode = "Permissive"
action.sessionId = "cf5cf2689379496aaa4449fd14dc8330"
DeleteImageAction.Result res = action.call()
PUT zstack/v1/images/{imageUuid}/actions
Authorization: OAuth the-session-uuid
{
"expungeImage": {
"backupStorageUuids": [
"ef3843bdde80427e9c8c0d4f05aa5cde"
]
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"expungeImage":{"backupStorageUuids":["3be136c8d8b8323bb94b8464aae4b0a7"]}}' \
http://localhost:8080/zstack/v1/images/4dcddfadcd113b5f89f181c4f4a080c7/actions
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
Uuid | String | body (contained in the params structure) | The resource UUID. | 0.6 | |
imageUuid | String | url | The image UUID. | 0.6 | |
backupStorageUuids | List | body (contained in the params structure) | Optional. The backup storage UUID list. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
ExpungeImageAction action = new ExpungeImageAction();
action.imageUuid = "ddb63556ae714ee78bf468d5067beedd";
action.backupStorageUuids = asList("6f21a1307fb24117a25ed907c00a3e47");
action.sessionId = "b12c879167d3459a844b6ac1f8ff3b74";
ExpungeImageAction.Result res = action.call();
ExpungeImageAction action = ExpungeImageAction()
action.imageUuid = "59fcc3775336469facfd93c5c16bdb2d"
action.backupStorageUuids = [2dfcf2dfadb14022ac09172a82fb3aac]
action.sessionId = "11fe68c420514cb0a8d8e1d1c5755d11"
ExpungeImageAction.Result res = action.call()
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for choosing ZStack products and services.