AddMiniStorage
API Request
URLs
POST zstack/v1/primary-storage/miniHeaders
Authorization: OAuth the-session-uuidBody
Note: In the example above,
{
"params": {
"diskIdentifier": "/dev/sdb",
"name": "mini storage 1",
"type": "MiniStorage",
"zoneUuid": "c1e53af7bd7c3a87a9fc7e482b37a29f"
},
"systemTags": [],
"userTags": []
}
Note: 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":{"diskIdentifier":"/dev/sdb","name":"mini storage 1","type":"MiniStorage","zoneUuid":"c1e53af7bd7c3a87a9fc7e482b37a29f"}}' \
http://localhost:8080/zstack/v1/primary-storage/miniParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| diskIdentifier | String | body(contained in params structure) |
The disk identifier. | 0.6 | |
| url | String | body(contained in params structure) |
The URL. | 0.6 | |
| name | String | body(contained in params structure) |
Resource Name | 0.6 | |
| description (Optional) | String | body(contained in params structure) |
Resource Description | 0.6 | |
| type (Optional) | String | body(contained in params structure) |
Optional. The resource type. | 0.6 | |
| zoneUuid | String | body(contained in params structure) |
Data Center UUID | 0.6 | |
| resourceUuid (Optional) | String | body(contained in params structure) |
Optional. The resource UUID. | 0.6 | |
| tagUuids (Optional) | List | body(contained in params structure) |
Tag UUID List | 3.4.0 | |
| systemTags (Optional) | List | body | Optional. The system tags. | 0.6 | |
| userTags (Optional) | List | body | Optional. The user tags. | 0.6 |
API Response
Response Example
{
"inventory": {
"name": "PS1",
"url": "/zstack_ps",
"type": "LocalStorage",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"c6e9684e8bb93a9192c946dcd0564b39"
]
}
}#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 | The URL. | 0.6 |
| description | String | Resource Description | 0.6 |
| totalCapacity | Long | The total capacity. | 0.6 |
| availableCapacity | Long | The available capacity. | 0.6 |
| totalPhysicalCapacity | Long | The total physical capacity. | 0.6 |
| availablePhysicalCapacity | Long | The available physical capacity. | 0.6 |
| systemUsedCapacity | Long | The system used capacity. | 0.6 |
| type | String | The resource type. | 0.6 |
| state | String | The resource state. | 0.6 |
| status | String | The resource status. | 0.6 |
| mountPath | String | The mount path. | 0.6 |
| createDate | Timestamp | Create Time | 0.6 |
| lastOpDate | Timestamp | Last Modification Time | 0.6 |
| attachedClusterUuids | List | The attached cluster UUIDs. | 0.6 |
SDK Examples
Java
SDK
AddMiniStorageAction action = new AddMiniStorageAction();
action.diskIdentifier = "/dev/sdb";
action.name = "mini storage 1";
action.type = "MiniStorage";
action.zoneUuid = "c1e53af7bd7c3a87a9fc7e482b37a29f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddMiniStorageAction.Result res = action.call();Python
SDK
AddMiniStorageAction action = AddMiniStorageAction()
action.diskIdentifier = "/dev/sdb"
action.name = "mini storage 1"
action.type = "MiniStorage"
action.zoneUuid = "c1e53af7bd7c3a87a9fc7e482b37a29f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddMiniStorageAction.Result res = action.call()