UpdatePrimaryStorage
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.
{
"updatePrimaryStorage": {
"name": "New PS1"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updatePrimaryStorage":{"name":"New PS1"}}' \
http://localhost:8080/zstack/v1/primary-storage/1ed3e2350ff736918ac97c2a4d7d2f6e/actions
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The primary storage UUID. | 0.6 | |
name | String | body (contained in the updatePrimaryStorage structure) | Optional. The new name of the primary storage. | 0.6 | |
description | String | body (contained in the updatePrimaryStorage structure) | Optional. The new description of the primary storage. | 0.6 | |
url | String | body (contained in the updatePrimaryStorage structure) | Optional. The new URL of the primary storage. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventory": {
"name": "New PS1",
"url": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"31d01fe839da465ca540292132b50209"
]
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | PrimaryStorageInventory | See inventory. | 0.6 |
#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. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
zoneUuid | String | The zone UUID. | 0.6 |
name | String | The resource name. | 0.6 |
url | String | 0.6 | |
description | String | The detailed description of the resource. | 0.6 |
totalCapacity | Long | 0.6 | |
availableCapacity | Long | 0.6 | |
totalPhysicalCapacity | Long | 0.6 | |
availablePhysicalCapacity | Long | 0.6 | |
systemUsedCapacity | Long | 0.6 | |
type | String | 0.6 | |
state | String | 0.6 | |
status | String | 0.6 | |
mountPath | String | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
attachedClusterUuids | List | 0.6 |
SDK Sample
Java
SDK
UpdatePrimaryStorageAction action = new UpdatePrimaryStorageAction();
action.uuid = "7253221c336c4510b97607943f3b1a3c";
action.name = "New PS1";
action.sessionId = "0f4cfa5daeb2408da149a88d99c90df4";
UpdatePrimaryStorageAction.Result res = action.call();
Python SDK
UpdatePrimaryStorageAction action = UpdatePrimaryStorageAction()
action.uuid = "e75ab68c9201465496fb27c9f6ff234b"
action.name = "New PS1"
action.sessionId = "b18ea5e60dcc445abfb3ffa28761c77e"
UpdatePrimaryStorageAction.Result res = action.call()