Discover External Primary Storage

POST/zstack/v1/primary-storage/addon/discover

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "http://operator:password@172.25.1.5:80"
  },
  "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":{"url":"http://operator:password@172.25.1.5:80"}}' \
http://localhost:8080/zstack/v1/primary-storage/addon/discover

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
urlStringbody(contained in params structure)  5.0.0
identity (Optional)Stringbody(contained in params structure)Storage Identity 5.0.0
config (Optional)Stringbody(contained in params structure)Configuration 5.0.0
systemTags (Optional)ListbodySystem Tags 5.0.0
userTags (Optional)ListbodyUser Tags 5.0.0

API Response

Response Example

{
  "inventory": {
    "identity": "expon",
    "addonInfo": {
      "pools": [
        {
          "name": "pool1",
          "availableCapacity": 100,
          "totalCapacity": 200
        },
        {
          "name": "pool2",
          "availableCapacity": 100,
          "totalCapacity": 200
        }
      ]
    },
    "uuid": "2cb103e920c034b7a709b9cc7e0394b8",
    "url": "http://operator:*****@172.25.1.5:80",
    "totalCapacity": 107374182400,
    "availableCapacity": 53687091200,
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
inventoryExternalPrimaryStorageInventorySee inventory5.0.0
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. See error5.0.0

inventory

NameTypeDescriptionStarting Version
identityStringStorage Identity5.0.0
configStringConfiguration5.0.0
addonInfoStringAdditional Information5.0.0
outputProtocolsListOutput Protocols5.0.0
defaultProtocolStringDefault Protocol5.0.0
uuidStringResource UUID, uniquely identifies the resource5.0.0
zoneUuidStringData Center UUID5.0.0
nameStringResource Name5.0.0
urlString 5.0.0
descriptionStringResource Description5.0.0
totalCapacityLong 5.0.0
availableCapacityLong 5.0.0
totalPhysicalCapacityLong 5.0.0
availablePhysicalCapacityLong 5.0.0
systemUsedCapacityLong 5.0.0
typeStringType5.0.0
stateString 5.0.0
statusString 5.0.0
mountPathString 5.0.0
createDateTimestampCreate Time5.0.0
lastOpDateTimestampLast Modification Time5.0.0
attachedClusterUuidsList 5.0.0

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

SDK Examples

Java SDK

DiscoverExternalPrimaryStorageAction action = new DiscoverExternalPrimaryStorageAction();
action.url = "http://operator:password@172.25.1.5:80";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DiscoverExternalPrimaryStorageAction.Result res = action.call();

Python SDK

DiscoverExternalPrimaryStorageAction action = DiscoverExternalPrimaryStorageAction()
action.url = "http://operator:password@172.25.1.5:80"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DiscoverExternalPrimaryStorageAction.Result res = action.call()