Attach Data Storage to Cluster

POST/zstack/v1/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {},
  "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 POST -d '{"params":{}}' http://localhost:8080/zstack/v1/clusters/06fa0d99fd9733409ea9dcb29e070fcf/primary-storage/e6df72f4eaaa324fb650cb7165bff218

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
clusterUuidStringurlCluster UUID 0.6
primaryStorageUuidStringurlData Storage UUID 0.6
systemTags (Optional)ListbodySystem Tags 0.6
userTags (Optional)ListbodyUser Tags 0.6

API Response

Response Example

{
  "inventory": {
    "name": "PS1",
    "url": "/Cloud_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "f0262ff5aeb54cd19e0a33bfaa61f5a4"
    ]
  }
}
NameTypeDescriptionStarting Version
successboolean 4.7.0
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

AttachPrimaryStorageToClusterAction action = new AttachPrimaryStorageToClusterAction();
action.clusterUuid = "473e453a99844ea2a3b65aa637d33841";
action.primaryStorageUuid = "ffd9b14c1c3442f2bde3209cbe9cc195";
action.sessionId = "97c7848a46b44ba89f348f434b5f2288";
AttachPrimaryStorageToClusterAction.Result res = action.call();

Python SDK

AttachPrimaryStorageToClusterAction action = AttachPrimaryStorageToClusterAction()
action.clusterUuid = "cfae196b0d514f9fbc6ecd5360cb6ccf"
action.primaryStorageUuid = "c122244cd9ab48fa80f61e781e98bb03"
action.sessionId = "c5b2cc8440fc4a6299c5f96a37d38a7f"
AttachPrimaryStorageToClusterAction.Result res = action.call()