Update Data Storage Information

PUT/zstack/v1/primary-storage/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updatePrimaryStorage": {
    "name": "New PS1"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, 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 PUT -d '{"updatePrimaryStorage":{"name":"New PS1"}}' \
http://localhost:8080/zstack/v1/primary-storage/1ed3e2350ff736918ac97c2a4d7d2f6e/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlData Storage UUID, uniquely identifies the resource 0.6
name (Optional)Stringbody(contained in the updatePrimaryStorage structure)New name for the Data Storage 0.6
description (Optional)Stringbody(contained in the updatePrimaryStorage structure)New description for the Data Storage 0.6
url (Optional)Stringbody(contained in the updatePrimaryStorage structure)New address for the Data Storage 0.6
systemTags (Optional)ListbodySystem Tags 0.6
userTags (Optional)ListbodyUser Tags 0.6

API Response

Response Example

{
  "inventory": {
    "name": "New PS1",
    "url": "/Cloud_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "31d01fe839da465ca540292132b50209"
    ]
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error0.6
inventoryPrimaryStorageInventorySee inventory0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that caused the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
zoneUuidStringData Center UUID0.6
nameStringResource Name0.6
urlString 0.6
descriptionStringResource Description0.6
totalCapacityLong 0.6
availableCapacityLong 0.6
totalPhysicalCapacityLong 0.6
availablePhysicalCapacityLong 0.6
systemUsedCapacityLong 0.6
typeString 0.6
stateString 0.6
statusString 0.6
mountPathString 0.6
createDateTimestampCreate Time0.6
lastOpDateTimestampLast Modification Time0.6
attachedClusterUuidsList 0.6

SDK Examples

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()