Storage Services

AddZStoneStorage

API Request

URLs
POST zstack/v1/zstone-plugin
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "zstone-storage",
    "username": "admin",
    "managementIp": "172.0.0.1",
    "logInPort": 4000,
    "apiPort": 4010,
    "logInUrl": "/sso/v1/accounts/login"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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":{"name":"zstone-storage","username":"admin","managementIp":"172.0.0.1","logInPort":4000,"apiPort":4010,"logInUrl":"/sso/v1/accounts/login"}}' \
http://localhost:8080/zstack/v1/zstone-plugin
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (included in params structure) Name of this ZStone-Storage in ZSphere 4.10.6
username (Optional) String body (included in params structure) Username for login, typically admin 4.10.6
password (Optional) String body (included in params structure) Password for login 4.10.6
managementIp String body (included in params structure) ZStone management node IP 4.10.6
logInPort (Optional) int body (included in params structure) ZStone login service port 4.10.6
apiPort (Optional) int body (included in params structure) ZStone API service port 4.10.6
logInUrl (Optional) String body (included in params structure) ZStone login URL 4.10.6
resourceUuid (Optional) String body (included in params structure) Resource UUID 4.10.6
tagUuids (Optional) List body (included in params structure) Tag UUID list 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

Response Example
{
  "inventory": {
    "uuid": "53c0433a817349f89f66532addeb8b6c",
    "name": "zstone-plugin",
    "username": "admin",
    "managementIp": "127.0.0.1",
    "authorizationServer": "Local",
    "logInPort": 4000,
    "apiPort": 4010,
    "logInUrl": "/sso/v1/accounts/login",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the creation was successful 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
AddZStoneAction action = new AddZStoneAction();
action.name = "zstone-storage";
action.username = "admin";
action.managementIp = "172.0.0.1";
action.logInPort = 4000;
action.apiPort = 4010;
action.logInUrl = "/sso/v1/accounts/login";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddZStoneAction.Result res = action.call();
Python SDK
AddZStoneAction action = AddZStoneAction()
action.name = "zstone-storage"
action.username = "admin"
action.managementIp = "172.0.0.1"
action.logInPort = 4000
action.apiPort = 4010
action.logInUrl = "/sso/v1/accounts/login"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddZStoneAction.Result res = action.call()

RemoveZStone

API Request

URLs
DELETE zstack/v1/zstone-plugin/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/zstone-plugin/53c0433a817349f89f66532addeb8b6c
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url ZStone UUID, uniquely identifies the resource 4.10.6
deleteMode (Optional) String body Delete mode (Permissive / Enforcing, Permissive) 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
RemoveZStoneAction action = new RemoveZStoneAction();
action.uuid = "53c0433a817349f89f66532addeb8b6c";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveZStoneAction.Result res = action.call();
Python SDK
RemoveZStoneAction action = RemoveZStoneAction()
action.uuid = "53c0433a817349f89f66532addeb8b6c"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveZStoneAction.Result res = action.call()

UpdateZStoneClusterConfig

API Request

URLs
PUT zstack/v1/zstone-plugin/config/cluster
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateZStoneClusterConfig": {
    "uuid": "53c0433a817349f89f66532addeb8b6c",
    "clusterName": "zstone-test",
    "chronyIp": "172.26.30.113",
    "publicNetworkCidr": "172.26.0.1/16",
    "clusterNetworkCidr": "172.26.0.1/16",
    "managementNetworkCidr": "172.26.0.1/16",
    "force": false
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 PUT -d '{"updateZStoneClusterConfig":{"uuid":"53c0433a817349f89f66532addeb8b6c","clusterName":"zstone-test","chronyIp":"172.26.30.113","publicNetworkCidr":"172.26.0.1/16","clusterNetworkCidr":"172.26.0.1/16","managementNetworkCidr":"172.26.0.1/16","force":false}}' \
http://localhost:8080/zstack/v1/zstone-plugin/config/cluster
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (included in updateZStoneClusterConfig structure) ZStone UUID, uniquely identifies the resource 4.10.6
clusterName String body (included in updateZStoneClusterConfig structure) ZStone cluster name 4.10.6
managementIp (Optional) String body (included in updateZStoneClusterConfig structure) ZStone management node IP 4.10.6
chronyIp String body (included in updateZStoneClusterConfig structure) ZStone time synchronization server IP 4.10.6
publicNetworkCidr String body (included in updateZStoneClusterConfig structure) ZStone public network IP CIDR 4.10.6
clusterNetworkCidr String body (included in updateZStoneClusterConfig structure) ZStone cluster network IP CIDR 4.10.6
managementNetworkCidrv String body (included in updateZStoneClusterConfig structure) ZStone management network IP CIDR 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6
force (Optional) boolean body (included in updateZStoneClusterConfig structure) Whether to forcibly add ZStone cluster. Generally, adding a cluster when ZStone already has one may cause unexpected issues, so this serves as a safeguard. 4.10.7
softwarePackageUuid String body (included in updateZStoneClusterConfig structure) Distributed software package UUID 4.10.20
Note:
  • Parameters for the initialization software package.
    • SystemTag format: initConfig::{%s}
    • SystemTag example: APIUpdateZStoneClusterConfigMsg converted to json string

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
UpdateZStoneClusterConfigAction action = new UpdateZStoneClusterConfigAction();
action.uuid = "53c0433a817349f89f66532addeb8b6c";
action.clusterName = "zstone-test";
action.chronyIp = "172.26.30.113";
action.publicNetworkCidr = "172.26.0.1/16";
action.clusterNetworkCidr = "172.26.0.1/16";
action.managementNetworkCidr = "172.26.0.1/16";
action.force = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateZStoneClusterConfigAction.Result res = action.call();
Python SDK
action = UpdateZStoneClusterConfigAction()
action.uuid = "53c0433a817349f89f66532addeb8b6c"
action.clusterName = "zstone-test"
action.chronyIp = "172.26.30.113"
action.publicNetworkCidr = "172.26.0.1/16"
action.clusterNetworkCidr = "172.26.0.1/16"
action.managementNetworkCidr = "172.26.0.1/16"
action.force = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UpdateZStoneHostConfig

API Request

URLs
PUT zstack/v1/zstone-plugin/config/host
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateZStoneHostConfig": {
    "uuid": "53c0433a817349f89f66532addeb8b6c",
    "hostPort": 22,
    "hosts": [
      {
        "uuid": "11045d20c4ae4d079b68d9aa9bd93e45",
        "managementIp": "172.30.3.21",
        "publicIp": "192.168.4.21"
      },
      {
        "uuid": "f76c6667db6a4c0bb220b895478effcc",
        "managementIp": "172.30.3.22",
        "publicIp": "192.168.4.22"
      },
      {
        "uuid": "0f7f889aebf0575bb223fc4f547854ef",
        "managementIp": "172.30.3.23",
        "publicIp": "192.168.4.23"
      }
    ],
    "deployChrony": false,
    "copySshKey": true,
    "installWatch": true,
    "updateHostname": true
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 PUT -d '{"updateZStoneHostConfig":{"uuid":"53c0433a817349f89f66532addeb8b6c","hostPort":22,"hosts":[{"uuid":"11045d20c4ae4d079b68d9aa9bd93e45","managementIp":"172.30.3.21","publicIp":"192.168.4.21"},{"uuid":"f76c6667db6a4c0bb220b895478effcc","managementIp":"172.30.3.22","publicIp":"192.168.4.22"},{"uuid":"0f7f889aebf0575bb223fc4f547854ef","managementIp":"172.30.3.23","publicIp":"192.168.4.23"}],"deployChrony":false,"copySshKey":true,"installWatch":true,"updateHostname":true}}' \
http://localhost:8080/zstack/v1/zstone-plugin/config/host
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (included in updateZStoneHostConfig structure) ZStone UUID, uniquely identifies the resource 4.10.6
hostUsername String body (included in updateZStoneHostConfig structure) Username for host login 4.10.6
hostPassword String body (included in updateZStoneHostConfig structure) Password for host login 4.10.6
hostPort (Optional) int body (included in updateZStoneHostConfig structure) ZStone host SSH port 4.10.6
hosts List body (included in updateZStoneHostConfig structure) ZStone host configuration list 4.10.6
deployChrony (Optional) boolean body (included in updateZStoneHostConfig structure) Whether to configure time synchronization service 4.10.6
copySshKey (Optional) boolean body (included in updateZStoneHostConfig structure) Whether to copy SSH KEY 4.10.6
installWatch (Optional) boolean body (included in updateZStoneHostConfig structure) Whether to install Watch 4.10.6
updateHostname (Optional) boolean body (included in updateZStoneHostConfig structure) Whether to update hostname 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
UpdateZStoneHostConfigAction action = new UpdateZStoneHostConfigAction();
action.uuid = "53c0433a817349f89f66532addeb8b6c";
action.hostPort = 22;
action.hosts = asList([uuid:11045d20c4ae4d079b68d9aa9bd93e45, managementIp:172.30.3.21, publicIp:192.168.4.21],[uuid:f76c6667db6a4c0bb220b895478effcc, managementIp:172.30.3.22, publicIp:192.168.4.22],[uuid:0f7f889aebf0575bb223fc4f547854ef, managementIp:172.30.3.23, publicIp:192.168.4.23]);
action.deployChrony = false;
action.copySshKey = true;
action.installWatch = true;
action.updateHostname = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateZStoneHostConfigAction.Result res = action.call();
Python SDK
UpdateZStoneHostConfigAction action = UpdateZStoneHostConfigAction()
action.uuid = "53c0433a817349f89f66532addeb8b6c"
action.hostPort = 22
action.hosts = [[uuid:11045d20c4ae4d079b68d9aa9bd93e45, managementIp:172.30.3.21, publicIp:192.168.4.21], [uuid:f76c6667db6a4c0bb220b895478effcc, managementIp:172.30.3.22, publicIp:192.168.4.22], [uuid:0f7f889aebf0575bb223fc4f547854ef, managementIp:172.30.3.23, publicIp:192.168.4.23]]
action.deployChrony = false
action.copySshKey = true
action.installWatch = true
action.updateHostname = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateZStoneHostConfigAction.Result res = action.call()

ZStoneTestConnection

API Request

URLs
PUT zstack/v1/zstone-plugin/test-connection
Headers
Authorization: OAuth the-session-uuid
Body
{
  "zStoneTestConnection": {
    "managementIp": "172.0.0.1",
    "port": 4010,
    "url": "/open/ping"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 PUT -d '{"zStoneTestConnection":{"managementIp":"172.0.0.1","port":4010,"url":"/open/ping"}}' \
http://localhost:8080/zstack/v1/zstone-plugin/test-connection
Parameter List
Name Type Location Description Allowed Values Starting Version
managementIp String body (included in zStoneTestConnection structure) ZStone management node IP 4.10.6
port (Optional) Integer body (included in zStoneTestConnection structure) ZStone API service port 4.10.6
url (Optional) String body (included in zStoneTestConnection structure) ZStone test connection URL 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
ZStoneTestConnectionAction action = new ZStoneTestConnectionAction();
action.managementIp = "172.0.0.1";
action.port = 4010;
action.url = "/open/ping";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ZStoneTestConnectionAction.Result res = action.call();
Python SDK
ZStoneTestConnectionAction action = ZStoneTestConnectionAction()
action.managementIp = "172.0.0.1"
action.port = 4010
action.url = "/open/ping"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ZStoneTestConnectionAction.Result res = action.call()

ZceXTestConnection

API Request

URLs
PUT zstack/v1/zce-x-plugin/test-connection
Headers
Authorization: OAuth the-session-uuid
Body
{
  "zceXTestConnection": {
    "managementIp": "172.0.0.1",
    "port": 8056,
    "url": "/api/v1/cluster/time"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 PUT -d '{"zceXTestConnection":{"managementIp":"172.0.0.1","port":8056,"url":"/api/v1/cluster/time"}}' \
http://localhost:8080/zstack/v1/zce-x-plugin/test-connection
Parameter List
Name Type Location Description Allowed Values Starting Version
managementIp (Optional) String body (included in zceXTestConnection structure) ZCE-X management node IP 4.10.7
port (Optional) Integer body (included in zceXTestConnection structure) ZCE-X API service port 4.10.7
uuid (Optional) String body (included in zceXTestConnection structure) ZCE-X VO UUID 4.10.16
url (Optional) String body (included in zceXTestConnection structure) ZCE-X test connection URL 4.10.7
adminToken (Optional) String body (included in zceXTestConnection structure) ZCE-X access-token. Can be filled in to check if access-token is available 4.10.16
systemTags (Optional) List body System Tag 4.10.7
userTags (Optional) List body User Tag 4.10.7

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
ZceXTestConnectionAction action = new ZceXTestConnectionAction();
action.managementIp = "172.0.0.1";
action.port = 8056;
action.url = "/api/v1/cluster/time";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ZceXTestConnectionAction.Result res = action.call();
Python SDK
action = ZceXTestConnectionAction()
action.managementIp = "172.0.0.1"
action.port = 8056
action.url = "/api/v1/cluster/time"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

AddZceX

API Request

URLs
POST zstack/v1/zce-x-plugin
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "zce-x-storage",
    "managementIp": "172.0.0.1",
    "apiPort": 8056
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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":{"name":"zce-x-storage","managementIp":"172.0.0.1","apiPort":8056}}' \
http://localhost:8080/zstack/v1/zce-x-plugin
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (included in params structure) ZCE-X name 4.10.6
adminToken (Optional) String body (included in params structure) Access token for taking over ZCE-X. Required when taking over, not needed before initialization 4.10.6
managementIp (Optional) String body (included in params structure) ZCE-X management network IP 4.10.6
apiPort (Optional) int body (included in params structure) ZCE-X API port 4.10.6
resourceUuid (Optional) String body (included in params structure) Resource UUID 4.10.6
tagUuids (Optional) List body (included in params structure) Tag UUID list 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

Response Example
{
  "inventory": {
    "uuid": "77e1393bf5aa4536a018b4c0c4e29c72",
    "name": "zce-x-plugin",
    "managementIp": "127.0.0.1",
    "apiPort": 8056,
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the addition was successful 4.10.6
inventory ZceXInventory For details, see inventory 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.10.6
name String Resource name 4.10.6
managementIp String IP address for accessing ZCE-X 4.10.6
apiPort int API port for accessing ZCE-X 4.10.6
createDate Timestamp Creation time 4.10.6
lastOpDate Timestamp Last modification time 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
AddZceXAction action = new AddZceXAction();
action.name = "zce-x-storage";
action.managementIp = "172.0.0.1";
action.apiPort = 8056;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddZceXAction.Result res = action.call();
Python SDK
AddZceXAction action = AddZceXAction()
action.name = "zce-x-storage"
action.managementIp = "172.0.0.1"
action.apiPort = 8056
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddZceXAction.Result res = action.call()

CreateZceXAlertPlatform

API Request

URLs
POST zstack/v1/zce-x-plugin/{uuid}/alert-platform
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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":{}}' \
http://localhost:8080/zstack/v1/zce-x-plugin/77e1393bf5aa4536a018b4c0c4e29c72/alert-platform
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url ZCE-X information UUID, uniquely identifies the resource 4.10.6
resourceUuid (Optional) String body (included in params structure) Resource UUID 4.10.6
tagUuids (Optional) List body (included in params structure) Tag UUID list 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

Response Example
{
  "thirdPartyPlatform": {
    "uuid": "eec32b6fe11a464790641439f1d7c754",
    "name": "xsky-172.20.11.24",
    "type": "XSKY",
    "url": "http://172.20.11.24:8086/alerts/?token\u003d001adb2ef25e41b7bd01b28651fcfa6a",
    "template": "{\n    \"product\":\"XSKY\",\n    \"service\":\"XSKY\",\n    \"message\":\"${resource_type + \u0027[\u0027 + resource_name+\u0027] \u0027 + group + \u0027 \u0027 + alert_value}\",\n    \"metric\":\"${resource_type + \u0027::\u0027 + group}\",\n    \"alertLevel\":\"${level \u003d\u003d \u0027info\u0027 ? \u0027Normal\u0027 : level \u003d\u003d \u0027warning\u0027 ? \u0027Important\u0027 : \u0027Emergent\u0027}\",\n    \"alertTime\":\"${create}\",\n    \"dimensions\":\"{\u0027resource_name\u0027:\u0027${resource_name}\u0027}\",\n    \"dataSource\":\"xsky-172.20.196.185\"\n}",
    "description": "desc",
    "lastSyncDate": "Feb 18, 2025 7:52:39 AM",
    "lastOpDate": "Feb 18, 2025 7:52:39 AM",
    "createDate": "Feb 18, 2025 7:52:39 AM"
  },
  "inventory": {
    "zceXUuid": "77e1393bf5aa4536a018b4c0c4e29c72",
    "thirdPartyPlatformUuid": "eec32b6fe11a464790641439f1d7c754",
    "createDate": "Nov 14, 2017 2:20:57 PM"
  }
}
Name Type Description Starting Version
success boolean Whether the addition was successful 4.10.6
thirdPartyPlatform ThirdpartyPlatformInventory For details, see thirdPartyPlatform 4.10.6
inventory ZceXThirdPartyPlatformAlertRefInventory For details, see inventory 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#thirdPartyPlatform
Name Type Description Starting Version
uuid String Platform UUID 3.10
name String Platform name 3.10
type String Platform type 3.10
url String Platform address 3.10
template String Message transformation template 3.10
state String Platform state 3.10
description String Platform detailed description 3.10
lastSyncDate Timestamp Last sync time 3.10
lastOpDate Timestamp Last modification time 3.10
createDate Timestamp Creation time 3.10
#inventory
Name Type Description Starting Version
zceXUuid String ZCE-X resource UUID 4.10.6
thirdPartyPlatformUuid String Associated third-party alert platform UUID 4.10.6
createDate Timestamp Creation time 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
CreateZceXAlertPlatformAction action = new CreateZceXAlertPlatformAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateZceXAlertPlatformAction.Result res = action.call();
Python SDK
CreateZceXAlertPlatformAction action = CreateZceXAlertPlatformAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateZceXAlertPlatformAction.Result res = action.call()

DeleteZceXAlertPlatform

API Request

URLs
DELETE zstack/v1/zce-x-plugin/{uuid}/alert-platform
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/zce-x-plugin/77e1393bf5aa4536a018b4c0c4e29c72/alert-platform
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url ZCE-X information UUID, uniquely identifies the resource 4.10.6
deleteMode (Optional) String body Delete mode (Permissive / Enforcing, Permissive) 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
DeleteZceXAlertPlatformAction action = new DeleteZceXAlertPlatformAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteZceXAlertPlatformAction.Result res = action.call();
Python SDK
DeleteZceXAlertPlatformAction action = DeleteZceXAlertPlatformAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteZceXAlertPlatformAction.Result res = action.call()

GetZceXCapability

API Request

URLs
GET zstack/v1/zce-x-plugin/capability
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin/capability?uuid=77e1393bf5aa4536a018b4c0c4e29c72
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String query ZCE-X information UUID, uniquely identifies the resource 4.10.6
systemTags (Optional) List query System Tag 4.10.6
userTags (Optional) List query User Tag 4.10.6

API Response

Response Example
{
  "licenses": {
    "platform": {
      "issuedTime": "2024-12-21T02:00:00Z",
      "expiredTime": "2024-12-21T02:00:00Z",
      "expired": false
    }
  },
  "cluster": {
    "managementNetworkCidr": "172.26.0.0/16",
    "gatewayNetworkCidr": "172.26.0.0/16",
    "publicNetworkCidr": "172.26.0.0/16",
    "clusterNetworkCidr": "192.168.15.0/24",
    "hosts": {
      "count": 3,
      "adminIps": [
        "192.168.0.1",
        "192.168.0.2",
        "192.168.0.3"
      ]
    },
    "pools": {
      "count": 3,
      "totalCapacity": 2199023255552,
      "inventories": [
        {
          "id": 3,
          "poolName": "pool-7548ffce72794737b439a9f8e3b2da83"
        },
        {
          "id": 2,
          "poolName": "pool-3e9f6251332a433e8d48c2edc95eb142"
        },
        {
          "id": 1,
          "poolName": "pool-37194c3c7bd74bdb8594cf768c4e42bd"
        }
      ]
    }
  }
}
Name Type Description Starting Version
success boolean Whether the get operation was successful 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
GetZceXCapabilityAction action = new GetZceXCapabilityAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZceXCapabilityAction.Result res = action.call();
Python SDK
GetZceXCapabilityAction action = GetZceXCapabilityAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetZceXCapabilityAction.Result res = action.call()

QueryZceX

API Request

URLs
GET zstack/v1/zce-x-plugin
GET zstack/v1/zce-x-plugin/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin?q=name=zce-x
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin/7746a57778193dcd9201c12a6dbc20fb

Queryable Fields

Run the CLI command tool, enter QueryZceX and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "77e1393bf5aa4536a018b4c0c4e29c72",
      "name": "zce-x-plugin",
      "managementIp": "127.0.0.1",
      "apiPort": 8056,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the query was successful 4.10.6
inventories List For details, see inventories 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 4.10.6
name String Resource name 4.10.6
managementIp String IP address for accessing ZCE-X 4.10.6
apiPort int API port for accessing ZCE-X 4.10.6
createDate Timestamp Creation time 4.10.6
lastOpDate Timestamp Last modification time 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
QueryZceXAction action = new QueryZceXAction();
action.conditions = asList("name=zce-x");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryZceXAction.Result res = action.call();
Python SDK
QueryZceXAction action = QueryZceXAction()
action.conditions = ["name=zce-x"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryZceXAction.Result res = action.call()

QueryZceXThirdPartyPlatformAlertRef

API Request

URLs
GET zstack/v1/zce-x-plugin/alert-platform
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zce-x-plugin/alert-platform?q=zceXUuid=77e1393bf5aa4536a018b4c0c4e29c72

Queryable Fields

Run the CLI command tool, enter QueryZceX and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "zceXUuid": "77e1393bf5aa4536a018b4c0c4e29c72",
      "thirdPartyPlatformUuid": "eec32b6fe11a464790641439f1d7c754",
      "createDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the query was successful 4.10.6
inventories List For details, see inventories 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#inventories
Name Type Description Starting Version
zceXUuid String ZCE-X resource UUID 4.10.6
thirdPartyPlatformUuid String Associated third-party alert platform UUID 4.10.6
createDate Timestamp Creation time 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
QueryZceXThirdPartyPlatformAlertRefAction action = new QueryZceXThirdPartyPlatformAlertRefAction();
action.conditions = asList("zceXUuid=77e1393bf5aa4536a018b4c0c4e29c72");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryZceXThirdPartyPlatformAlertRefAction.Result res = action.call();
Python SDK
QueryZceXThirdPartyPlatformAlertRefAction action = QueryZceXThirdPartyPlatformAlertRefAction()
action.conditions = ["zceXUuid=77e1393bf5aa4536a018b4c0c4e29c72"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryZceXThirdPartyPlatformAlertRefAction.Result res = action.call()

RemoveZceX

API Request

URLs
DELETE zstack/v1/zce-x-plugin/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/zce-x-plugin/77e1393bf5aa4536a018b4c0c4e29c72
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url ZCE-X UUID, uniquely identifies the resource 4.10.6
deleteMode (Optional) String body Delete mode (Permissive / Enforcing, Permissive) 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
RemoveZceXAction action = new RemoveZceXAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveZceXAction.Result res = action.call();
Python SDK
RemoveZceXAction action = RemoveZceXAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveZceXAction.Result res = action.call()

UpdateZceXClusterConfig

API Request

URLs
PUT zstack/v1/zce-x-plugin/config/cluster
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateZceXClusterConfig": {
    "uuid": "77e1393bf5aa4536a018b4c0c4e29c72",
    "managementNetworkCidr": "172.26.30.1/24",
    "publicNetworkCidr": "172.26.30.1/24",
    "clusterNetworkCidr": "172.26.30.1/24",
    "otherManagementIp": [
      "172.26.30.113",
      "172.26.30.202"
    ],
    "username": "admin"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 PUT -d '{"updateZceXClusterConfig":{"uuid":"77e1393bf5aa4536a018b4c0c4e29c72","managementNetworkCidr":"172.26.30.1/24","publicNetworkCidr":"172.26.30.1/24","clusterNetworkCidr":"172.26.30.1/24","otherManagementIp":["172.26.30.113","172.26.30.202"],"username":"admin"}}' \
http://localhost:8080/zstack/v1/zce-x-plugin/config/cluster
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String body (included in updateZceXClusterConfig structure) ZCE-X UUID, uniquely identifies the resource 4.10.6
managementIp (Optional) String body (included in updateZceXClusterConfig structure) ZCE-X management node IP. If not filled, defaults to ZceXVO.uuid 4.10.6
managementNetworkCidr String body (included in updateZceXClusterConfig structure) ZCE-X management network IP CIDR 4.10.6
publicNetworkCidr String body (included in updateZceXClusterConfig structure) ZCE-X public network IP CIDR 4.10.6
clusterNetworkCidr String body (included in updateZceXClusterConfig structure) ZCE-X cluster network IP CIDR 4.10.6
gatewayNetworkCidr (Optional) String body (included in updateZceXClusterConfig structure) ZCE-X gateway network IP CIDR, defaults to public network IP CIDR 4.10.6
otherManagementIp List body (included in updateZceXClusterConfig structure) Other two ZCE-X management node IPs. Must provide two different IPs. Passwordless authentication is required between nodes 4.10.6
otherStorageIp (Optional) List body (included in updateZceXClusterConfig structure) Other ZCE-X storage node IP list 4.10.6
username (Optional) String body (included in updateZceXClusterConfig structure) Administrator username created during ZCE-X initialization 4.10.6
password (Optional) String body (included in updateZceXClusterConfig structure) Administrator password created during ZCE-X initialization 4.10.6
systemTags (Optional) List body System Tag 4.10.6
userTags (Optional) List body User Tag 4.10.6
softwarePackageUuid String body (included in updateZceXClusterConfig structure) Distributed software package UUID 4.10.20
Note:
  • Parameters for the initialization software package.
    • SystemTag format: initConfig::{%s}
    • SystemTag example: APIUpdateZceXClusterConfigMsg converted to json string

API Response

Response Example
{
  "initSuccess": true,
  "tokenCreated": true
}
Name Type Description Starting Version
clusterInitSuccess boolean Whether initialization was successful 4.10.20
tokenCreated boolean Whether token generation was successful 4.10.20
success boolean Whether configuration was successful 4.10.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 4.10.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 4.10.0
description String Brief summary of the error 4.10.0
details String Detailed error information 4.10.0
elaboration String Reserved field, defaults to null 4.10.0
opaque LinkedHashMap Reserved field, defaults to null 4.10.0
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 4.10.0

SDK Examples

Java SDK
UpdateZceXClusterConfigAction action = new UpdateZceXClusterConfigAction();
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72";
action.managementNetworkCidr = "172.26.30.1/24";
action.publicNetworkCidr = "172.26.30.1/24";
action.clusterNetworkCidr = "172.26.30.1/24";
action.otherManagementIp = asList("172.26.30.113","172.26.30.202");
action.username = "admin";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateZceXClusterConfigAction.Result res = action.call();
Python SDK
action = UpdateZceXClusterConfigAction()
action.uuid = "77e1393bf5aa4536a018b4c0c4e29c72"
action.managementNetworkCidr = "172.26.30.1/24"
action.publicNetworkCidr = "172.26.30.1/24"
action.clusterNetworkCidr = "172.26.30.1/24"
action.otherManagementIp = [172.26.30.113, 172.26.30.202]
action.username = "admin"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

BootstrapMiniHost

API Request

URLs
POST zstack/v1/mini-clusters/hosts
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "local": {
      "sn": "RD-BJD-001-07311A",
      "ipmi": {
        "gw": "172.20.27.1",
        "ip": "172.20.27.21/24",
        "vlan": "27"
      },
      "mgmt": {
        "gw": "172.20.26.1",
        "ip": "172.20.26.21/24",
        "vlan": "26",
        "bond": "lacp"
      }
    },
    "peer": {
      "sn": "RD-BJD-001-07311B",
      "mgmt": {
        "gw": "172.20.26.1",
        "ip": "172.20.26.22/24",
        "vlan": "26",
        "bond": "ab"
      }
    }
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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":{"local":{"sn":"RD-BJD-001-07311A","ipmi":{"gw":"172.20.27.1","ip":"172.20.27.21/24","vlan":"27"},"mgmt":{"gw":"172.20.26.1","ip":"172.20.26.21/24","vlan":"26","bond":"lacp"}},"peer":{"sn":"RD-BJD-001-07311B","mgmt":{"gw":"172.20.26.1","ip":"172.20.26.22/24","vlan":"26","bond":"ab"}}}}' \
http://localhost:8080/zstack/v1/mini-clusters/hosts
Parameter List
Name Type Location Description Allowed Values Starting Version
local MiniHostInfo body (included in params structure) The local. 3.6.0
peer MiniHostInfo body (included in params structure) The peer. 3.6.0
resourceUuid (Optional) String body (included in params structure) Optional. The resource UUID. 3.6.0
tagUuids (Optional) List body (included in params structure) Tag UUID list 3.6.0
systemTags (Optional) List body Optional. The system tags. 3.6.0
userTags (Optional) List body Optional. The user tags. 3.6.0

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

GetCandidateMiniHosts

API Request

URLs
GET zstack/v1/mini-clusters/candidate-hosts
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/mini-clusters/candidate-hosts?local=false&configure=false
Parameter List
Name Type Location Description Allowed Values Starting Version
local (Optional) boolean query Optional. The local. 3.6.0
systemTags (Optional) List query Optional. The system tags. 3.6.0
userTags (Optional) List query Optional. The user tags. 3.6.0
configure (Optional) boolean query Optional. The configure. 0.6

API Response

Response Example
{
  "hosts": [
    {
      "hostName": "zstack-mini-07311a",
      "ipv4Address": "172.20.26.21",
      "ipv6Address": "fe80::ae1f:6bff:fe93:9a72",
      "ipv4Interface": "br_bond0_26",
      "ipv6Interface": "br_bond0_26",
      "manufacturer": "ZStack",
      "product": "ZOHCN05",
      "sn": "RD-BJD-001-07311A"
    },
    {
      "hostName": "zstack-mini-07311b",
      "ipv4Address": "172.20.26.22",
      "ipv6Address": "fe80::ae1f:6bff:fe92:8a7a",
      "ipv4Interface": "br_bond0_26",
      "ipv6Interface": "br_bond0_26",
      "manufacturer": "ZStack",
      "product": "ZOHCN05",
      "sn": "RD-BJD-001-07311B"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 3.6.0
hosts List For details, see hosts 3.6.0
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary 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 triggered the current error. If there is no original error, this field is null 0.6
#hosts
Name Type Description Starting Version
hostName String Hostname 3.6.0
ipv4Address String IPv4 address 3.6.0
ipv6Address String IPv6 address 3.6.0
ipv4Interface String IPv4 interface 3.6.0
ipv6Interface String IPv6 interface 3.6.0
manufacturer String Manufacturer 3.6.0
product String Model 3.6.0
sn String SN code 3.6.0

SDK Examples

Java SDK
GetCandidateMiniHostsAction action = new GetCandidateMiniHostsAction();
action.local = false;
action.configure = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateMiniHostsAction.Result res = action.call();
Python SDK
GetCandidateMiniHostsAction action = GetCandidateMiniHostsAction()
action.local = false
action.configure = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateMiniHostsAction.Result res = action.call()

CreateMiniCluster

API Request

URLs
POST zstack/v1/mini-clusters
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "zoneUuid": "45e31d9d03cc3528bce3a286e2284b2e",
    "name": "cluster1",
    "username": "root",
    "sshPort": 22,
    "description": "test",
    "hypervisorType": "KVM"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the above example, 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 GET http://localhost:8080/zstack/v1/mini-clusters/candidate-hosts?local=false&configure=false
Parameter List
Name Type Location Description Allowed Values Starting Version
zoneUuid String body (included in params structure) Data Center UUID 0.6
name String body (included in params structure) Resource name 0.6
hostManagementIps List body (included in params structure) The host management ips. 0.6
username (Optional) String body (included in params structure) Optional. The username. 0.6
password String body (included in params structure) The password. 0.6
sshPort (Optional) int body (included in params structure) Optional. The SSH port. 0.6
description (Optional) String body (included in params structure) Resource detailed description 0.6
hypervisorType String body (included in params structure) The hypervisor type.
  • KVM
  • Simulator
0.6
resourceUuid (Optional) String body (included in params structure) Resource UUID 0.6
tagUuids (Optional) List body (included in params structure) Tag UUID list 3.4.0
systemTags (Optional) List body System Tag 0.6
userTags (Optional) List body User Tag 0.6

API Response

Response Example
{
  "inventory": {
    "name": "mini-cluster1",
    "uuid": "7189b28ec2103b8387db01465c23c44d",
    "description": "test",
    "state": "Enabled",
    "hypervisorType": "KVM",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM",
    "zoneUuid": "eec8fdc928883758990e16608a50b12a",
    "type": "zstack"
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 0.6
inventory ClusterInventory For details, see inventory 0.6
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. For details, see error 0.6
#inventory
Name Type Description Starting Version
name String Resource name 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
description String Resource detailed description 0.6
state String Cluster state 0.6
hypervisorType String Hypervisor type 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
zoneUuid String Data Center UUID 0.6
type String Reserved field 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary 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 triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
CreateMiniClusterAction action = new CreateMiniClusterAction();
action.zoneUuid = "45e31d9d03cc3528bce3a286e2284b2e";
action.name = "cluster1";
action.username = "root";
action.sshPort = 22;
action.description = "test";
action.hypervisorType = "KVM";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateMiniClusterAction.Result res = action.call();
Python SDK
CreateMiniClusterAction action = CreateMiniClusterAction()
action.zoneUuid = "45e31d9d03cc3528bce3a286e2284b2e"
action.name = "cluster1"
action.username = "root"
action.sshPort = 22
action.description = "test"
action.hypervisorType = "KVM"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateMiniClusterAction.Result res = action.call()

CleanSoftwarePackage

API Request

URLs
DELETE zstack/v1/software-package/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/software-package/ff04e1736ec6391f9a1f023b524d0a00?deleteMode=Permissive
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Software package UUID 4.10.20
deleteMode (Optional) String query Delete mode (Permissive / Enforcing, Permissive) 4.10.20
systemTags (Optional) List query System Tag 4.10.20
userTags (Optional) List query User Tag 4.10.20

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
CleanSoftwarePackageAction action = new CleanSoftwarePackageAction();
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CleanSoftwarePackageAction.Result res = action.call();
Python SDK
action = CleanSoftwarePackageAction()
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

GetDirectoryUsage

API Request

URLs
GET zstack/v1/software-package/directory/usage
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/software-package/directory/usage?managementNodeUuid=ff000842a4673ab39dad7a3990df5300&directoryPath=/root/installPath/file
Parameter List
Name Type Location Description Allowed Values Starting Version
managementNodeUuid String query Management Node UUID 4.10.20
directoryPath String query Directory absolute path 4.10.20
systemTags (Optional) List query System Tag 4.10.20
userTags (Optional) List query User Tag 4.10.20

API Response

Response Example
{
  "totalCapacity": 1024,
  "availableCapacity": 512
}
Name Type Description Starting Version
totalCapacity long Total capacity 4.10.20
availableCapacity long Available capacity 4.10.20
success boolean Returns true if the operation was successful, otherwise false 4.10.20
error ErrorCode For details, see error 4.10.20
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief summary 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 triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
GetDirectoryUsageAction action = new GetDirectoryUsageAction();
action.managementNodeUuid = "ff000842a4673ab39dad7a3990df5300";
action.directoryPath = "/root/installPath/file";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetDirectoryUsageAction.Result res = action.call();
Python SDK
action = GetDirectoryUsageAction()
action.managementNodeUuid = "ff000842a4673ab39dad7a3990df5300"
action.directoryPath = "/root/installPath/file"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

GetUploadSoftwarePackageJobDetails

API Request

URLs
GET zstack/v1/software-package/upload-jobs/details/{softwarePackageId}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/software-package/upload-jobs/details/ff04e1736ec6391f9a1f023b524d0a00
Parameter List
Name Type Location Description Allowed Values Starting Version
softwarePackageId String url The software package ID (default is hash value). 4.10.20
systemTags (Optional) List query The system tags. 4.10.20
userTags (Optional) List query The user tags. 4.10.20

API Response

Sample Response
{
  "existingJobDetails": [
    {
      "longJobUuid": "ff05232082b53f4f8e657884f462f600",
      "longJobState": "Running",
      "softwarePackageUuid": "ff04e1736ec6391f9a1f023b524d0a00",
      "softwarePackageUploadUrl": "http://127.0.0.1:8001/host/file/upload",
      "offset": 452984832
    }
  ]
}
Name Type Description Starting Version
success boolean The operation success. True if success, false otherwise. 4.10.20
existingJobDetails List See existingJobDetails. 4.10.20
error ErrorCode See error. 4.10.20
#existingJobDetails
Name Type Description Starting Version
longJobUuid String The task UUID. 4.10.20
longJobState String The task status. 4.10.20
softwarePackageUuid String The software package UUID. 4.10.20
softwarePackageUploadUrl String The software package upload URL. 4.10.20
offset long The upload offset. 4.10.20
#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 brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String Reserved field. Default value: null. 0.6
opaque LinkedHashMap 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

SDK Sample

Java SDK
GetUploadSoftwarePackageJobDetailsAction action = new GetUploadSoftwarePackageJobDetailsAction();
action.softwarePackageId = "ff04e1736ec6391f9a1f023b524d0a00";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetUploadSoftwarePackageJobDetailsAction.Result res = action.call();
Python SDK
action = GetUploadSoftwarePackageJobDetailsAction()
action.softwarePackageId = "ff04e1736ec6391f9a1f023b524d0a00"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

InstallSoftwarePackage

API Request

URLs
PUT zstack/v1/software-package/install/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "installSoftwarePackage": {
    "config": "{}"
  },
  "systemTags": [],
  "userTags": []
}
Note: 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 PUT -d '{"installSoftwarePackage":{"config":"{}"}}' \
http://localhost:8080/zstack/v1/software-package/install/ff04e1736ec6391f9a1f023b524d0a00/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url The software package UUID. 4.10.20
config (Optional) String body (contained in the installSoftwarePackage structure) The software package installation configuration. 4.10.20
systemTags (Optional) List body The system tags. 4.10.20
userTags (Optional) List body The user tags. 4.10.20
Note:
  • The parameters for installing the software package.
    • SystemTag format: installConfig::{%s}
    • SystemTag example: APIInstallSoftwarePackageMsg converted to json string

API Response

This API returns an empty JSON structure {} on success, and returns a JSON structure containing an error field on failure. For example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
InstallSoftwarePackageAction action = new InstallSoftwarePackageAction();
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00";
action.config = "{}";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
InstallSoftwarePackageAction.Result res = action.call();
Python SDK
action = InstallSoftwarePackageAction()
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00"
action.config = "{}"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

QuerySoftwarePackage

API Request

URLs
GET zstack/v1/software-package
GET zstack/v1/software-package/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/software-package?q=uuid=ff04e1736ec6391f9a1f023b524d0a00
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/software-package/dbe8d717b4f7335580774fabc403cc78

Queryable Fields

Run the CLI command tool, enter QuerySoftwarePackage and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "53c0433a817349f89f66532addeb8b6c",
      "name": "SoftwarePackage",
      "hostUuid": "53c0433a817349f89f66532addeb8b61",
      "managementNodeUuid": "53c0433a817349f89f66532addeb8b62",
      "installPath": "/root/file/ZStone-common-installer-5.4.18-1932.tar.gz",
      "unzipInstallPath": "/root/file/ZStone-common-installer-5.4.18-1932.tar.gz_2c1571fab770b5bab7f411d48aad5029_1762415407323/zstone-installer",
      "type": "zstone",
      "md5sum": "53c0433a817349f89f66532addeb8b63",
      "status": "Uploaded",
      "size": 1024,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.10.20
inventories List See inventories. 4.10.20
error ErrorCode See error. 4.10.20
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 4.10.20
name String The resource name. 4.10.20
hostUuid String The Host UUID. 4.10.20
managementNodeUuid String The Management Node UUID. 4.10.20
installPath String The installation path. 4.10.20
unzipInstallPath String The unzip installation path. 4.10.20
type String The installation package type. 4.10.20
md5sum String The installation package MD5 checksum value. 4.10.20
status String The installation package status. 4.10.20
size long The installation package size. 4.10.20
createDate Timestamp The creation date. 4.10.20
lastOpDate Timestamp The last operation date. 4.10.20
#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 brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String Reserved field. Default value: null. 0.6
opaque LinkedHashMap 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

SDK Sample

Java SDK
QuerySoftwarePackageAction action = new QuerySoftwarePackageAction();
action.conditions = asList("uuid=ff04e1736ec6391f9a1f023b524d0a00");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySoftwarePackageAction.Result res = action.call();
Python SDK
action = QuerySoftwarePackageAction()
action.conditions = ["uuid=ff04e1736ec6391f9a1f023b524d0a00"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UninstallSoftwarePackage

API Request

URLs
PUT zstack/v1/software-package/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "uninstallSoftwarePackage": {},
  "systemTags": [],
  "userTags": []
}
Note: 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 PUT -d '{"uninstallSoftwarePackage":{}}' \
http://localhost:8080/zstack/v1/software-package/ff04e1736ec6391f9a1f023b524d0a00/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url The software package UUID. 4.10.20
systemTags (Optional) List body The system tags. 4.10.20
userTags (Optional) List body The user tags. 4.10.20

API Response

This API returns an empty JSON structure {} on success, and returns a JSON structure containing an error field on failure. For example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
UninstallSoftwarePackageAction action = new UninstallSoftwarePackageAction();
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UninstallSoftwarePackageAction.Result res = action.call();
Python SDK
action = UninstallSoftwarePackageAction()
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UploadSoftwarePackage

API Request

URLs
POST zstack/v1/software-packages/upload
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "software-package-name",
    "type": "storage",
    "managementNodeUuid": "ff000842a4673ab39dad7a3990df5300",
    "hostUuid": "ff0192fa70113da886101145c084bd00",
    "url": "http://192.168.1.1/disk/images/test.qcow2",
    "installPath": "/root/sds/storage.tar.gz"
  },
  "systemTags": [],
  "userTags": []
}
Note: 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":{"name":"software-package-name","type":"storage","managementNodeUuid":"ff000842a4673ab39dad7a3990df5300","hostUuid":"ff0192fa70113da886101145c084bd00","url":"http://192.168.1.1/disk/images/test.qcow2","installPath":"/root/sds/storage.tar.gz"}}' \
http://localhost:8080/zstack/v1/software-packages/upload
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (contained in the params structure) The software package name. 4.10.20
type String body (contained in the params structure) The software package type. 4.10.20
managementNodeUuid String body (contained in the params structure) The Management Node UUID. 4.10.20
hostUuid String body (contained in the params structure) The Host UUID. 4.10.20
url String body (contained in the params structure) The software package URL. 4.10.20
installPath String body (contained in the params structure) The software package installation path. 4.10.20
resourceUuid (Optional) String body (contained in the params structure) The resource UUID. 4.10.20
tagUuids (Optional) List body (contained in the params structure) The tag UUID list. 4.10.20
systemTags (Optional) List body The system tags. 4.10.20
userTags (Optional) List body The user tags. 4.10.20
Note:
  • Local upload software supports specifying the hash of the software package.
    • SystemTag format: uploadSoftwarePackage::{%s}
    • SystemTag example: uploadSoftwarePackage::1271232183768712367812361287
  • Local upload host returns the URL for UI to upload software package slices.
    • SystemTag format: uploadUrl::{%s}
    • SystemTag example: uploadUrl::http://172.1.1.1:7070/host/file/direct-upload
  • Parameters for uploading the software package.
    • SystemTag format: uploadConfig::{%s}
    • SystemTag example: APIUploadSoftwarePackageMsg converted to json string

API Response

Sample Response
{
  "inventory": {
    "size": 0
  }
}
Name Type Description Starting Version
success boolean The operation success. True if success, false otherwise. 4.10.20
error ErrorCode See error. 4.10.20
inventory SoftwarePackageInventory See inventory. 4.10.20
#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 brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String Reserved field. Default value: null. 0.6
opaque LinkedHashMap 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. 4.10.20
name String The resource name. 4.10.20
hostUuid String The Host UUID. 4.10.20
managementNodeUuid String The Management Node UUID. 4.10.20
installPath String The installation path. 4.10.20
unzipInstallPath String The unzip installation path. 4.10.20
type String The installation package type. 4.10.20
md5sum String The installation package MD5 checksum value. 4.10.20
status String The installation package status. 4.10.20
size long The installation package size. 4.10.20
createDate Timestamp The creation date. 4.10.20
lastOpDate Timestamp The last operation date. 4.10.20

SDK Sample

Java SDK
UploadSoftwarePackageAction action = new UploadSoftwarePackageAction();
action.name = "software-package-name";
action.type = "storage";
action.managementNodeUuid = "ff000842a4673ab39dad7a3990df5300";
action.hostUuid = "ff0192fa70113da886101145c084bd00";
action.url = "http://192.168.1.1/disk/images/test.qcow2";
action.installPath = "/root/sds/storage.tar.gz";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadSoftwarePackageAction.Result res = action.call();
Python SDK
action = UploadSoftwarePackageAction()
action.name = "software-package-name"
action.type = "storage"
action.managementNodeUuid = "ff000842a4673ab39dad7a3990df5300"
action.hostUuid = "ff0192fa70113da886101145c084bd00"
action.url = "http://192.168.1.1/disk/images/test.qcow2"
action.installPath = "/root/sds/storage.tar.gz"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UploadAndExecuteSoftwareUpgradePackage

API Request

URLs
POST zstack/v1/software-packages/backup-storage/{uuid}/upgrade
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "upgradeType": "Normal"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the 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":{"upgradeType":"Normal"}}' \
http://localhost:8080/zstack/v1/software-packages/backup-storage/ff04e1736ec6391f9a1f023b524d0a00/upgrade
Parameters
Name Type Location Description Valid Values Since
uuid String url UUID of the software package resource 5.0.0
backupStorageUuid (optional) String body(contained in the params structure) Backup storage UUID 5.0.0
url (optional) String body(contained in the params structure) Optional. The URL. 5.0.0
installPath (optional) String body(contained in the params structure) Optional. The installation path. 5.0.0
upgradeType (optional) String body(contained in the params structure) Optional. The upgrade type.
  • Normal
  • Reexecute
5.0.0
systemTags (optional) List body System tags 5.0.0
userTags (optional) List body User tags 5.0.0

API Response

When this API succeeds, it returns an empty JSON structure {}. When an error occurs, the returned JSON structure contains an error field. Example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Example

Java SDK
UploadAndExecuteSoftwareUpgradePackageAction action = new UploadAndExecuteSoftwareUpgradePackageAction();
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00";
action.upgradeType = "Normal";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadAndExecuteSoftwareUpgradePackageAction.Result res = action.call();
Python SDK
action = UploadAndExecuteSoftwareUpgradePackageAction()
action.uuid = "ff04e1736ec6391f9a1f023b524d0a00"
action.upgradeType = "Normal"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UploadSoftwarePackageToBackupStorage

API Request

URLs
POST zstack/v1/software-packages/backup-storage/upload
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "software-package-name",
    "type": "ZMigrate",
    "backupStorageUuid": "ff081de062bd338eb907962028e64d00",
    "url": "http://192.168.1.1/disk/images/test.qcow2",
    "installPath": "/root/zmigrate.tar.gz"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding example, the 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":{"name":"software-package-name","type":"ZMigrate","backupStorageUuid":"ff081de062bd338eb907962028e64d00","url":"http://192.168.1.1/disk/images/test.qcow2","installPath":"/root/zmigrate.tar.gz"}}' \
http://localhost:8080/zstack/v1/software-packages/backup-storage/upload
Parameters
Name Type Location Description Valid Values Since
name String body(contained in the params structure) Resource name 5.0.0
type String body(contained in the params structure) Software package type 5.0.0
backupStorageUuid (optional) String body(contained in the params structure) Backup storage UUID 5.0.0
url String body(contained in the params structure) Software package URL 5.0.0
installPath String body(contained in the params structure) Installation path 5.0.0
resourceUuid (optional) String body(contained in the params structure) Resource UUID 5.0.0
tagUuids (optional) String body(contained in the params structure) Tag UUID list 5.0.0
systemTags (optional) List body System tags 5.0.0
userTags (optional) List body User tags 5.0.0

API Response

Response Example
{
  "inventory": {
    "size": 0
  }
}
Name Type Description Since
success boolean Whether the operation succeeded. 5.0.0
inventory SoftwarePackageInventory For details, see inventory 5.0.0
error ErrorCode For details, see error 5.0.0
#inventory
Name Type Description Since
uuid String Resource UUID, which uniquely identifies the resource 4.10.20
name String Resource name 4.10.20
hostUuid String host UUID 4.10.20
managementNodeUuid String UUID of the management node to which the package is uploaded 4.10.20
installPath String Installation path 4.10.20
unzipInstallPath String Extraction installation path 4.10.20
type String Installation package type 4.10.20
md5sum String MD5 checksum of the installation package 4.10.20
status String Installation package status 4.10.20
size long Installation package size 4.10.20
createDate Timestamp Creation time 4.10.20
lastOpDate Timestamp Last modification time 4.10.20
#error
Name Type Description Since
code String Error code, a globally unique identifier of the error, for example, SYS.1000 or HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed information about the error 0.6
elaboration String Reserved field. The default value is null 0.6
opaque LinkedHashMap Reserved field. The default value is null 0.6
cause ErrorCode Root error, which is the source error that caused the current error. If there is no source error, this field is null 0.6

SDK Example

Java SDK
UploadSoftwarePackageToBackupStorageAction action = new UploadSoftwarePackageToBackupStorageAction();
action.name = "software-package-name";
action.type = "ZMigrate";
action.backupStorageUuid = "ff081de062bd338eb907962028e64d00";
action.url = "http://192.168.1.1/disk/images/test.qcow2";
action.installPath = "/root/zmigrate.tar.gz";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadSoftwarePackageToBackupStorageAction.Result res = action.call();
Python SDK
action = UploadSoftwarePackageToBackupStorageAction()
action.name = "software-package-name"
action.type = "ZMigrate"
action.backupStorageUuid = "ff081de062bd338eb907962028e64d00"
action.url = "http://192.168.1.1/disk/images/test.qcow2"
action.installPath = "/root/zmigrate.tar.gz"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center