Image Storage Related InterfacesImage Related Interfaces
Query Image
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth ecf1dc42b51d4c7c8f814bd10ac0ba79" \
-X GET http://localhost:8080/zstack/v1/images?q=uuid=0538611eb03a48e0bbcfd08e528f0aa1curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 69e2477d74ae4b53a19b21ee6e88f9da" \
-X GET http://localhost:8080/zstack/v1/images/21897673f8274d319c4aeba92e8e4c73Queryable Fields
Run the CLI command tool, enter QueryImage and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
Response Example
{
"inventories": [
{
"actualSize": 7995392,
"backupStorageRefs": [
{
"backupStorageUuid": "bbc730b63081460198c1c7cb63025255",
"createDate": "Mar 10, 2018 2:35:09 PM",
"imageUuid": "2402b660b6f1582bb65246597b2f47f2",
"installPath": "zstore://2402b660b6f1582bb65246597b2f47f2/2ab567b512cc696f2207cf0e3260baa4982e1c02",
"lastOpDate": "Mar 10, 2018 2:35:09 PM",
"status": "Ready"
}
],
"createDate": "Mar 10, 2018 2:35:09 PM",
"description": "",
"format": "qcow2",
"lastOpDate": "Mar 10, 2018 2:35:10 PM",
"md5Sum": "f0fde821df71aaec63063bef1fb0a46a231e5a3fbb37ed5671eabee7563eb3f8",
"mediaType": "RootVolumeTemplate",
"name": "Image-1",
"platform": "Linux",
"size": 12682240,
"state": "Enabled",
"status": "Ready",
"system": false,
"type": "zstack",
"url": "file:///opt/zstack-dvd/zstack-image-1.4.qcow2",
"uuid": "2402b660b6f1582bb65246597b2f47f2"
}
],
"success": true
}SDK Examples
Java SDK
QueryImageAction action = new QueryImageAction();
action.conditions = asList("uuid=02928c0d94a847b0b785bc9830f931c6");
action.sessionId = "512102357b3e44c7a1704240176c8661";
QueryImageAction.Result res = action.call();Python SDK
QueryImageAction action = QueryImageAction()
action.conditions = ["uuid=4d4b95071b09499e9e15a206714d1586"]
action.sessionId = "893c8fe44f5b4b799b095c54ee7ae075"
QueryImageAction.Result res = action.call()