Add External Primary Storage
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"identity": "zbd",
"url": "vendorname://user:password@host:port/pool",
"name": "my primary storage"
},
"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":{"identity":"zbd","url":"vendorname://user:password@host:port/pool","name":"my primary storage"}}' \
http://localhost:8080/zstack/v1/primary-storage/addonParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
identity | String | body(contained in | Storage Identity |
| 5.0.0 |
defaultOutputProtocol | String | body(contained in | Default Output Protocol |
| 5.0.0 |
config (Optional) | String | body(contained in | Configuration |
| 5.0.0 |
url | String | body(contained in |
|
| 5.0.0 |
name | String | body(contained in | Resource Name |
| 5.0.0 |
description (Optional) | String | body(contained in | Resource Description |
| 5.0.0 |
type (Optional) | String | body(contained in | Type |
| 5.0.0 |
zoneUuid | String | body(contained in | Data Center UUID |
| 5.0.0 |
resourceUuid (Optional) | String | body(contained in | Resource UUID |
| 5.0.0 |
tagUuids (Optional) | List | body(contained in | Tag UUID List |
| 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": {
"name": "PS1",
"url": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"c6e9684e8bb93a9192c946dcd0564b39"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation succeeds, this field is null. See error | 0.6 |
| inventory | PrimaryStorageInventory | See inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier for the error, for example 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 caused 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 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource Name | 0.6 |
| url | String | 0.6 | |
| description | String | Resource Description | 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 | Create Time | 0.6 |
| lastOpDate | Timestamp | Last Modification Time | 0.6 |
| attachedClusterUuids | List | 0.6 |
SDK Examples
Java SDK
AddExternalPrimaryStorageAction action = new AddExternalPrimaryStorageAction();
action.identity = "zbd";
action.url = "vendorname://user:password@host:port/pool";
action.name = "my primary storage";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddExternalPrimaryStorageAction.Result res = action.call();Python SDK
AddExternalPrimaryStorageAction action = AddExternalPrimaryStorageAction()
action.identity = "zbd"
action.url = "vendorname://user:password@host:port/pool"
action.name = "my primary storage"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddExternalPrimaryStorageAction.Result res = action.call()