Document navigation

AddStorageProtocol

API Request

URLs

POST zstack/v1/primary-storage/protocol

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "uuid": "68c75f0058b93c61b30188e37b8fc5e9",
    "outputProtocol": "iSCSI"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"68c75f0058b93c61b30188e37b8fc5e9","outputProtocol":"iSCSI"}}' \
http://localhost:8080/zstack/v1/primary-storage/protocol

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String body (contained in the params structure) The resource UUID. 5.1.0
outputProtocol String body (contained in the params structure) The output protocol. 5.1.0
systemTags List body Optional.The system tags. 5.1.0
userTags List body Optional. The user tags. 5.1.0

API Response

Response Sample

{
    "error": {
        "code": "SYS.1001",
        "description": "A message or a operation timeout",
        "details": "Create VM on KVM timeout after 300s"
    }
}

SDK Sample

Java SDK

AddStorageProtocolAction action = new AddStorageProtocolAction();
action.uuid = "68c75f0058b93c61b30188e37b8fc5e9";
action.outputProtocol = "iSCSI";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddStorageProtocolAction.Result res = action.call();

Python SDK

action = AddStorageProtocolAction()
action.uuid = "68c75f0058b93c61b30188e37b8fc5e9"
action.outputProtocol = "iSCSI"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()