ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/zstone-pluginAuthorization: OAuth the-session-uuid{ "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 -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| 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 |
{ "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 |
| 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 |
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();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()DELETE zstack/v1/zstone-plugin/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/zstone-plugin/53c0433a817349f89f66532addeb8b6c| 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 |
{} 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" } }RemoveZStoneAction action = new RemoveZStoneAction(); action.uuid = "53c0433a817349f89f66532addeb8b6c"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; RemoveZStoneAction.Result res = action.call();RemoveZStoneAction action = RemoveZStoneAction() action.uuid = "53c0433a817349f89f66532addeb8b6c" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" RemoveZStoneAction.Result res = action.call()PUT zstack/v1/zstone-plugin/config/clusterAuthorization: OAuth the-session-uuid{ "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 -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| 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: initConfig::{%s}APIUpdateZStoneClusterConfigMsg converted to json string{} 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" } }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();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()