AttachPrimaryStorageToCluster
API Request
URLs
POST zstack/v1/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}Headers
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.
{
"params": {},
"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 POST -d '{"params":{}}' http://localhost:8080/zstack/v1/clusters/06fa0d99fd9733409ea9dcb29e070fcf/primary-storage/e6df72f4eaaa324fb650cb7165bff218Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| clusterUuid | String | url | The cluster UUID. | 0.6 | |
| primaryStorageUuid | String | url | The primary storage UUID. | 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": "PS1",
"url": "/Cloud_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"f0262ff5aeb54cd19e0a33bfaa61f5a4"
]
}
}#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 brief description of the error. | 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
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()