Create Mini Cluster
Headers
Authorization: OAuth the-session-uuidBody
{
"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=falseParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
zoneUuid | String | body (included in | Data Center UUID |
| 0.6 |
name | String | body (included in | Resource name |
| 0.6 |
hostManagementIps | List | body (included in |
|
| 0.6 |
username (Optional) | String | body (included in |
|
| 0.6 |
password | String | body (included in |
|
| 0.6 |
sshPort (Optional) | int | body (included in |
|
| 0.6 |
description (Optional) | String | body (included in | Resource detailed description |
| 0.6 |
hypervisorType | String | body (included in |
|
| 0.6 |
resourceUuid (Optional) | String | body (included in | Resource UUID |
| 0.6 |
tagUuids (Optional) | List | body (included in | 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 | 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()