AddLocalPrimaryStorage
API Request
URLs
POST zstack/v1/primary-storage/local-storage
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"url": "/zstack_ps",
"name": "PS1",
"zoneUuid": "a71cbd7404e9474c81ed45d167b7eab8"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"/zstack_ps","name":"PS1","zoneUuid":"3b9a66322185343e9068b2bfd185b690"}}' \
http://localhost:8080/zstack/v1/primary-storage/local-storage
Request Parameters
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
url | String | body (contained in the params structure) | The URL of the local storage. | 0.6 | |
name | String | body (contained in the params structure) | The name of the local storage. | 0.6 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the local storage. | 0.6 | |
type | String | body (contained in the params structure) | Optional. The primary storage type: LocalStorage. | 0.6 | |
zoneUuid | String | body (contained in the params structure) | The zone UUID. | 0.6 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. If specified, the local storage will use this field as the 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": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"562116d368c8467c95c53321757538dc"
]
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | PrimaryStorageInventory | See inventory. | 0.6 |
#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 short 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
AddLocalPrimaryStorageAction action = new AddLocalPrimaryStorageAction();
action.url = "/zstack_ps";
action.name = "PS1";
action.zoneUuid = "e9762e3b848e4d0a8f36f1b2fe888b14";
action.sessionId = "01b750dce9e94191abd9216fe8c5e77b";
AddLocalPrimaryStorageAction.Result res = action.call();
Python
SDK
AddLocalPrimaryStorageAction action = AddLocalPrimaryStorageAction()
action.url = "/zstack_ps"
action.name = "PS1"
action.zoneUuid = "bd54c662683b4144b33a72a357064387"
action.sessionId = "b6dd1fd80b7144adbf23d4b1089d978d"
AddLocalPrimaryStorageAction.Result res = action.call()