Image Storage Related InterfacesImage Related Interfaces

Update Image

PUT/zstack/v1/images/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateImage": {
    "platform": "Windows",
    "virtio": false
  },
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateImage":{"platform":"Windows","virtio":false}}' http://localhost:8080/zstack/v1/images/38549d5d5a3d3c5caefc18d8a9e0aa13/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

uuid

String

url

Image UUID, uniquely identifies the Image

 

0.6

name (Optional)

String

body (contained in params structure)

Image name

 

0.6

description (Optional)

String

body (contained in params structure)

Detailed description of the Image

 

0.6

guestOsType (Optional)

String

body (contained in params structure)

Guest Operating System type corresponding to the Image

 

0.6

mediaType (Optional)

String

body (contained in params structure)

Image type

  • RootVolumeTemplate
  • DataVolumeTemplate
  • ISO

0.6

format (Optional)

String

body (contained in params structure)

Image format

  • raw
  • qcow2
  • iso

0.6

system (Optional)

Boolean

body (contained in params structure)

Indicates whether it is a system Image

 

0.6

platform (Optional)

String

body (contained in params structure)

Image system platform

  • Linux
  • Windows
  • WindowsVirtio
  • Other
  • Paravirtualization

0.6

architecture (Optional)

String

body (contained in updateImage structure)

 

  • x86_64
  • aarch64
  • mips64el

4.0.0

systemTags (Optional)

List

body

System Tags

 

0.6

userTags (Optional)

List

body

User Tags

 

0.6

API Response

Response Example

{
  "inventory": {
    "uuid": "fadea0efc22e3e6fa43f537f1af6ee6b",
    "name": "TinyLinux",
    "url": "http://192.168.1.20/share/images/tinylinux.qcow2",
    "mediaType": "RootVolumeTemplate",
    "platform": "Windows",
    "architecture": "x86_64",
    "format": "qcow2",
    "backupStorageRefs": [
      {
        "id": 0.0,
        "imageUuid": "fadea0efc22e3e6fa43f537f1af6ee6b",
        "backupStorageUuid": "b94ff32725d133fea53e8ada5ea7f0fc",
        "installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd",
        "status": "Ready"
      }
    ]
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error0.6
inventoryImageInventorySee inventory0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that triggered the current error. This field is null if there is no original error0.6

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
nameStringResource name0.6
descriptionStringDetailed description of the resource0.6
stateStringImage boot state4.0.0
statusStringImage ready state4.0.0
sizeLongImage size4.0.0
actualSizeLongImage actual capacity4.0.0
md5SumStringImage md5 value4.0.0
urlStringImage URL address4.0.0
mediaTypeStringImage type4.0.0
guestOsTypeStringGuest Operating System type corresponding to the Image4.0.0
typeStringInternal use field4.0.0
platformStringImage system platform4.0.0
formatStringImage format, for example: raw4.0.0
systemBooleanIndicates whether it is a system Image4.0.0
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6
backupStorageRefsListSee backupStorageRefs0.6

backupStorageRefs

NameTypeDescriptionStarting Version
imageUuidStringImage UUID0.6
backupStorageUuidStringImage Storage UUID0.6
installPathStringInstallation path on the Image Storage4.0.0
exportUrlStringExport Image URL4.0.0
exportMd5SumStringExport Image md5 value4.0.0
statusStringImage ready state4.0.0
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

UpdateImageAction action = new UpdateImageAction();
action.uuid = "38549d5d5a3d3c5caefc18d8a9e0aa13";
action.platform = "Windows";
action.virtio = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateImageAction.Result res = action.call();

Python SDK

UpdateImageAction action = UpdateImageAction()
action.uuid = "38549d5d5a3d3c5caefc18d8a9e0aa13"
action.platform = "Windows"
action.virtio = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateImageAction.Result res = action.call()