Create Mini Cluster

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": []
}

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)

 

 

0.6

username (Optional)

String

body (included in params structure)

 

 

0.6

password

String

body (included in params structure)

 

 

0.6

sshPort (Optional)

int

body (included in params structure)

 

 

0.6

description (Optional)

String

body (included in params structure)

Resource detailed description

 

0.6

hypervisorType

String

body (included in params structure)

 

  • 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"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
inventoryClusterInventoryFor details, see inventory0.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. For details, see error0.6

inventory

NameTypeDescriptionStarting Version
nameStringResource name0.6
uuidStringResource UUID, uniquely identifies the resource0.6
descriptionStringResource detailed description0.6
stateStringCluster state0.6
hypervisorTypeStringHypervisor type0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.6
zoneUuidStringData Center UUID0.6
typeStringReserved field0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief summary 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 triggered the current error. If there is no original error, this field is null0.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()