Add ZStone(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()

Remove ZStone(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()

Configure ZStone Cluster(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()























Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.