Image Storage Related InterfacesImage Related Interfaces

Recover Image

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

Recover an Image that has been deleted (but not completely removed).

Headers

Authorization: OAuth the-session-uuid

Body

{
  "recoverImage": {
    "backupStorageUuids": [
      "b63989ade2194ce8b8f1823083395681"
    ]
  },
  "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 5ab0e924388a44d7aa96b9e7df9d8df3" \
-X PUT -d '{"recoverImage":{"backupStorageUuids":["29849ef8f0fe3abeb8fff5e6d947d002"]}}' \
http://localhost:8080/zstack/v1/images/e55bb56eee93338cad8d7d1048a6b0c3/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
imageUuidStringurlImage UUID 0.6
backupStorageUuids (Optional)Listbody (contained in params structure)Image Storage UUID List 0.6
systemTags (Optional)ListbodySystem Tags 0.6
userTags (Optional)ListbodyUser Tags 0.6

API Response

Response Example

{
  "inventory": {
    "uuid": "c019173f2b5742868058049be43033a1",
    "name": "TinyLinux",
    "url": "http://192.168.1.20/share/images/tinylinux.qcow2",
    "mediaType": "RootVolumeTemplate",
    "platform": "Linux",
    "format": "qcow2",
    "backupStorageRefs": [
      {
        "id": 0.0,
        "imageUuid": "c019173f2b5742868058049be43033a1",
        "backupStorageUuid": "609d29fb59ee414f90cedbc3a71038c6",
        "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 state0.6
statusStringImage ready state0.6
sizeLongImage size0.6
actualSizeLongImage actual capacity0.6
md5SumStringImage md5 value0.6
urlStringImage URL address0.6
mediaTypeStringImage type0.6
guestOsTypeStringGuest Operating System type corresponding to the Image0.6
typeStringInternal use field0.6
platformStringImage system platform0.6
formatStringImage format, for example: raw0.6
systemBooleanIndicates whether it is a system Image0.6
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 Storage0.6
exportUrlStringExport Image URL0.6
exportMd5SumStringExport Image md5 value0.6
statusStringImage ready state0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

RecoverImageAction action = new RecoverImageAction();
action.imageUuid = "3220b5ea2ae24883a4eb847634e3e349";
action.backupStorageUuids = asList("ad4dcd853b894362bfd18c06779ed758");
action.sessionId = "66ba41da8526424d9ab70ed0072b8d22";
RecoverImageAction.Result res = action.call();

Python SDK

RecoverImageAction action = RecoverImageAction()
action.imageUuid = "7f8bb365b8d3413ab5d09f6d381552c3"
action.backupStorageUuids = [14d99a1ade5a431ea254902c808d7319]
action.sessionId = "044d56deddd849a092ff02ae54386cf1"
RecoverImageAction.Result res = action.call()