Image Storage Related InterfacesImage Related Interfaces

Sync Image Size

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "syncImageSize": {},
  "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 3a29210c52824730884918d670745453" \
-X PUT -d '{"syncImageSize":{}}' \
http://localhost:8080/zstack/v1/images/7d0fb69a716330bba16a3ee557ee0ab2/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlImage UUID, uniquely identifies the Image 0.6
systemTags (Optional)ListbodySystem Tags 0.6
userTags (Optional)ListbodyUser Tags 0.6

API Response

Response Example

{
  "inventory": {
    "uuid": "a5288a2598074daabb0450db1eaf0e69",
    "name": "TinyLinux",
    "size": 209715200.0,
    "actualSize": 2329057.0,
    "url": "http://192.168.1.20/share/images/tinylinux.qcow2",
    "mediaType": "RootVolumeTemplate",
    "platform": "Linux",
    "format": "qcow2",
    "backupStorageRefs": [
      {
        "id": 0.0,
        "imageUuid": "a5288a2598074daabb0450db1eaf0e69",
        "backupStorageUuid": "1a917c0b47c6475a996ed678f230419d",
        "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
stateString 0.6
statusString 0.6
sizeLong 0.6
actualSizeLong 0.6
md5SumString 0.6
urlString 0.6
mediaTypeString 0.6
guestOsTypeString 0.6
typeString 0.6
platformString 0.6
formatString 0.6
systemBoolean 0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6
backupStorageRefsListSee backupStorageRefs0.6

backupStorageRefs

NameTypeDescriptionStarting Version
imageUuidStringImage UUID0.6
backupStorageUuidStringImage Storage UUID0.6
installPathString 0.6
exportUrlString 0.6
exportMd5SumString 0.6
statusString 0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6

SDK Examples

Java SDK

SyncImageSizeAction action = new SyncImageSizeAction();
action.uuid = "46638764dfcb47b2bf916bce60d50f9f";
action.sessionId = "557e2989aa7d4178861c4fcacb85e40c";
SyncImageSizeAction.Result res = action.call();

Python SDK

SyncImageSizeAction action = SyncImageSizeAction()
action.uuid = "0073e30d1fd84cd0b47896e5bb22b205"
action.sessionId = "e6896c8311824d718e330908ec04d9a6"
SyncImageSizeAction.Result res = action.call()