Add Distributed Storage Pool
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"poolName": "highPerformance",
"aliasName": "alias pool name",
"description": "for high performance data volumes",
"isCreate": true
"type": "ROOT
},
"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 Examples
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"poolName":"highPerformance","aliasName":"alias pool name","description":"for high performance data volumes","isCreate":true,"type":"Root"}}' http://localhost:8080/zstack/v1/primary-storage/ceph/fe5adfa6042b33cd8ee7b5bcd994245f/poolsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| primaryStorageUuid | String | url | Primary Storage UUID | 0.6 | |
| poolName | String | body (nested in params structure) | 0.6 | ||
| aliasName (optional) | String | body (nested in params structure) | 0.6 | ||
| description (optional) | String | body (nested in params structure) | Resource description | 0.6 | |
| isCreate (optional) | boolean | body (nested in params structure) | 0.6 | ||
| type | String | body (nested in params structure) | Storage pool type | 3.1.1 | |
| resourceUuid (optional) | String | body (nested in params structure) | 0.6 | ||
| systemTags (optional) | List | body | 0.6 | ||
| userTags (optional) | List | body | 0.6 |
API Response
Response Example
{
"inventory": {
"uuid": "97ac9dc5fc223f80918747a8a398478b",
"primaryStorageUuid": "82b127a3f6cc3ec7bd7ff01069310099",
"poolName": "pool name",
"aliasName": "alias name",
"description": "description",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"type": "Data"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | For details, see error | 0.6 |
| inventory | CephPrimaryStoragePoolInventory | For details, see inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
inventory
Name | Type | Description | Starting Version |
|---|---|---|---|
uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
primaryStorageUuid | String | Primary Storage UUID | 0.6 |
poolName | String |
| 0.6 |
aliasName | String |
| 0.6 |
description | String | Resource description | 0.6 |
createDate | Timestamp | Creation time | 0.6 |
lastOpDate | Timestamp | Last modification time | 0.6 |
type | String |
| 0.6 |
availableCapacity | Long |
| 2.3.2 |
usedCapacity | Long |
| 2.3.2 |
replicatedSize | Integer |
| 2.3.2 |
SDK Examples
Java SDK
AddCephPrimaryStoragePoolAction action = new AddCephPrimaryStoragePoolAction();
action.primaryStorageUuid = "fe5adfa6042b33cd8ee7b5bcd994245f";
action.poolName = "highPerformance";
action.aliasName = "alias pool name";
action.description = "for high performance data volumes";
action.isCreate = true;
action.type = "Root"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddCephPrimaryStoragePoolAction.Result res = action.call();Python SDK
AddCephPrimaryStoragePoolAction action = AddCephPrimaryStoragePoolAction()
action.primaryStorageUuid = "fe5adfa6042b33cd8ee7b5bcd994245f"
action.poolName = "highPerformance"
action.aliasName = "alias pool name"
action.type = "Root"
action.description = "for high performance data volumes"
action.isCreate = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddCephPrimaryStoragePoolAction.Result res = action.call()