CleanUpStorageTrashOnPrimaryStorage
API Request
URLs
PUT zstack/v1/primary-storage/{uuid}/storagetrash/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"cleanUpStorageTrashOnPrimaryStorage": {
"force": false
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"cleanUpStorageTrashOnPrimaryStorage":{"force":false}}' \
http://localhost:8080/zstack/v1/primary-storage/238259a845cb344bbb5ad7013f91d644/storagetrash/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The primary storage UUID. | 4.8.0 | |
| force | boolean | body (contained in the cleanUpStorageTrashOnPrimaryStorage structure) | Whether or not to force the primary storage to be cleaned. | 4.8.0 | |
| systemTags | List | body | Optional. The system tags. | 4.8.0 | |
| userTags | List | body | Optional. The user tags. | 4.8.0 |
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,
{
"result": {
"pool-2": [
"E92501AC0F30486282317C3412E27307",
"876D1F78BB35405DBBFEC61226B13FDA"
],
"pool-1": [
"09f35ca96dfa4f7d8171a6583bbcc4fe",
"7ae6b23ab27e48b7b7abd25c22f1f91a"
]
},
"total": 4
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.8.0 | |
| result | Map | The collection of successfully cleaned primary storage. | 4.8.0 |
| total | Integer | The number of successfully cleaned primary storage. | 4.8.0 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.8.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.8.0 |
| description | String | The brief description of the error. | 4.8.0 |
| details | String | The details about the error. | 4.8.0 |
| elaboration | String | The reserved field. Default value: null. | 4.8.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.8.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.8.0 |
SDK Sample
Java
SDK
CleanUpStorageTrashOnPrimaryStorageAction action = new CleanUpStorageTrashOnPrimaryStorageAction();
action.uuid = "238259a845cb344bbb5ad7013f91d644";
action.force = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CleanUpStorageTrashOnPrimaryStorageAction.Result res = action.call();Python
SDK
CleanUpStorageTrashOnPrimaryStorageAction action = CleanUpStorageTrashOnPrimaryStorageAction()
action.uuid = "238259a845cb344bbb5ad7013f91d644"
action.force = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CleanUpStorageTrashOnPrimaryStorageAction.Result res = action.call()