Add Mini Storage

POST/zstack/v1/primary-storage/mini

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "diskIdentifier": "/dev/sdb",
    "name": "mini storage 1",
    "type": "MiniStorage",
    "zoneUuid": "c1e53af7bd7c3a87a9fc7e482b37a29f"
  },
  "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":{"diskIdentifier":"/dev/sdb","name":"mini storage 1","type":"MiniStorage","zoneUuid":"c1e53af7bd7c3a87a9fc7e482b37a29f"}}' \
http://localhost:8080/zstack/v1/primary-storage/mini

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
diskIdentifierStringbody(contained in params structure)  0.6
urlStringbody(contained in params structure)  0.6
nameStringbody(contained in params structure)Resource Name 0.6
description (Optional)Stringbody(contained in params structure)Resource Description 0.6
type (Optional)Stringbody(contained in params structure)  0.6
zoneUuidStringbody(contained in params structure)Data Center UUID 0.6
resourceUuid (Optional)Stringbody(contained in params structure)  0.6
tagUuids (Optional)Listbody(contained in params structure)Tag UUID List 3.4.0
systemTags (Optional)Listbody  0.6
userTags (Optional)Listbody  0.6

API Response

Response Example

{
  "inventory": {
    "name": "PS1",
    "url": "/zstack_ps",
    "type": "LocalStorage",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "c6e9684e8bb93a9192c946dcd0564b39"
    ]
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error0.6
inventoryPrimaryStorageInventorySee inventory0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that caused the current error. If there is no original error, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
zoneUuidStringData Center UUID0.6
nameStringResource Name0.6
urlString 0.6
descriptionStringResource Description0.6
totalCapacityLong 0.6
availableCapacityLong 0.6
totalPhysicalCapacityLong 0.6
availablePhysicalCapacityLong 0.6
systemUsedCapacityLong 0.6
typeString 0.6
stateString 0.6
statusString 0.6
mountPathString 0.6
createDateTimestampCreate Time0.6
lastOpDateTimestampLast Modification Time0.6
attachedClusterUuidsList 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()