CleanUpImageCacheOnPrimaryStorage
API Request
URLs
PUT zstack/v1/primary-storage/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"cleanUpImageCacheOnPrimaryStorage": {},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"cleanUpImageCacheOnPrimaryStorage":{}}' \
http://localhost:8080/zstack/v1/primary-storage/06e884ad8dbf3ed0bb061f4645b17075/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The primary storage UUID. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes an error field. For
example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
SDK Sample
Java
SDK
CleanUpImageCacheOnPrimaryStorageAction action = new CleanUpImageCacheOnPrimaryStorageAction();
action.uuid = "cb50319265d540e19cbf98137fcbca0e";
action.sessionId = "5dc546cb18cc46b885412564a39c512f";
CleanUpImageCacheOnPrimaryStorageAction.Result res = action.call();
Python
SDK
CleanUpImageCacheOnPrimaryStorageAction action = CleanUpImageCacheOnPrimaryStorageAction()
action.uuid = "cd35f62a64cd4daf9397f2e3bf5e910b"
action.sessionId = "e3ef197e97264195903b0fbdf52ae4c7"
CleanUpImageCacheOnPrimaryStorageAction.Result res = action.call()