Image Storage Related InterfacesImage Related Interfaces

Get Upload Image Job Details

PUT/zstack/v1/images/upload-job/details/{imageId}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "setImageBootMode": {
    "bootMode": "Legacy"
  },
  "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 GET http://localhost:8080/zstack/v1/images/upload-job/details/d41d8cd98f00b204e9800998ecf8427e?

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
imageIdStringurlUnique identifier for the image upload, user-defined, md5 recommended 4.1.0
systemTags (Optional)ListbodySystem Tags 4.1.0
userTags (Optional)ListbodyUser Tags 4.1.0

API Response

Response Example

{
  "existingJobDetails": [
    {
      "longJobUuid": "0792dd52aeb9329cb1e677fae6465f23",
      "longJobState": "Suspended",
      "imageUuid": "ccf943310d86335bb3d2511ca8e14137",
      "imageUploadUrl": "http://127.0.0.1:8001/imagestore/upload",
      "offset": 452984832.0
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.1.0
existingJobDetails See existingJobDetails4.1.0

error

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

existingJobDetails

NameTypeDescriptionStarting Version
longJobUuidStringLong job UUID4.1.0
longJobStateStringLong job state4.1.0
imageUuidStringImage UUID4.1.0
imageUploadUrlStringImage upload URL4.1.0
offsetlongUpload offset, in bytes4.1.0

SDK Examples

Java SDK

GetUploadImageJobDetailsAction action = new GetUploadImageJobDetailsAction();
action.imageId = "d41d8cd98f00b204e9800998ecf8427e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetUploadImageJobDetailsAction.Result res = action.call();

Python SDK

GetUploadImageJobDetailsAction action = GetUploadImageJobDetailsAction()
action.imageId = "d41d8cd98f00b204e9800998ecf8427e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetUploadImageJobDetailsAction.Result res = action.call()