Update External Primary Storage

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateExternalPrimaryStorage": {
    "config": "{\"pools\":[{\"name\":\"pool1\",\"aliasName\":\"pool-high\"}]}",
    "defaultProtocol": "Vhost",
    "name": "My Primary Storage",
    "description": "New description"
  },
  "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 '{"updateExternalPrimaryStorage":{"config":"{\"pools\":[{\"name\":\"pool1\",\"aliasName\":\"pool-high\"}]}","defaultProtocol":"Vhost","name":"My Primary Storage","description":"New description"}}' \
http://localhost:8080/zstack/v1/primary-storage/addon/6275cc909e313b63a00acf1eea7a7e18/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

config (Optional)

String

body(contained in updateExternalPrimaryStorage structure)

Configuration

 

5.0.0

defaultProtocol (Optional)

String

body(contained in updateExternalPrimaryStorage structure)

Default Protocol

  • Vhost
  • Scsi
  • Nvme
  • Curve
  • file

5.0.0

uuid

String

url

Resource UUID, uniquely identifies the resource

 

5.0.0

name (Optional)

String

body(contained in updateExternalPrimaryStorage structure)

Resource Name

 

5.0.0

description (Optional)

String

body(contained in updateExternalPrimaryStorage structure)

Resource Description

 

5.0.0

url (Optional)

String

body(contained in updateExternalPrimaryStorage structure)

 

 

5.0.0

systemTags (Optional)

List

body

System Tags

 

5.0.0

userTags (Optional)

List

body

User Tags

 

5.0.0

API Response

Response Example

{
  "inventory": {
    "identity": "expon",
    "config": {
      "pools": [
        {
          "name": "pool1",
          "aliasName": "pool-high"
        },
        {
          "name": "pool2"
        }
      ]
    },
    "addonInfo": {
      "pools": [
        {
          "name": "pool1",
          "availableCapacity": 100,
          "totalCapacity": 200
        },
        {
          "name": "pool2",
          "availableCapacity": 100,
          "totalCapacity": 200
        }
      ]
    },
    "uuid": "f40dbde502013ea98a7fe9a30bac95a3",
    "url": "http://operator:*****@172.25.1.5:80",
    "totalCapacity": 107374182400,
    "availableCapacity": 53687091200,
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
inventoryExternalPrimaryStorageInventorySee inventory5.0.0
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error5.0.0

inventory

NameTypeDescriptionStarting Version
identityStringStorage Identity5.0.0
configStringConfiguration5.0.0
addonInfoStringAdditional Information5.0.0
outputProtocolsListOutput Protocols5.0.0
defaultProtocolStringDefault Protocol5.0.0
uuidStringResource UUID, uniquely identifies the resource5.0.0
zoneUuidStringData Center UUID5.0.0
nameStringResource Name5.0.0
urlString 5.0.0
descriptionStringResource Description5.0.0
totalCapacityLong 5.0.0
availableCapacityLong 5.0.0
totalPhysicalCapacityLong 5.0.0
availablePhysicalCapacityLong 5.0.0
systemUsedCapacityLong 5.0.0
typeStringType5.0.0
stateString 5.0.0
statusString 5.0.0
mountPathString 5.0.0
createDateTimestampCreate Time5.0.0
lastOpDateTimestampLast Modification Time5.0.0
attachedClusterUuidsList 5.0.0

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

SDK Examples

Java SDK

UpdateExternalPrimaryStorageAction action = new UpdateExternalPrimaryStorageAction();
action.config = "{"pools":[{"name":"pool1","aliasName":"pool-high"}]}";
action.defaultProtocol = "Vhost";
action.uuid = "6275cc909e313b63a00acf1eea7a7e18";
action.name = "My Primary Storage";
action.description = "New description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateExternalPrimaryStorageAction.Result res = action.call();

Python SDK

UpdateExternalPrimaryStorageAction action = UpdateExternalPrimaryStorageAction()
action.config = "{"pools":[{"name":"pool1","aliasName":"pool-high"}]}"
action.defaultProtocol = "Vhost"
action.uuid = "6275cc909e313b63a00acf1eea7a7e18"
action.name = "My Primary Storage"
action.description = "New description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateExternalPrimaryStorageAction.Result res = action.call()