POST zstack/v1/zstone-plugin
Authorization: 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": [] }
systemTags
、userTags
字段可以省略。列出是为了表示body中可以包含这两个字段。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 | String | body(包含在params 结构中) | 在 ZSphere 中这个 ZStone-Storage 的名称 | 4.10.6 | |
username (可选) | String | body(包含在params 结构中) | 登录使用的用户名,一般是 admin | 4.10.6 | |
password (可选) | String | body(包含在params 结构中) | 登录使用的密码 | 4.10.6 | |
managementIp | String | body(包含在params 结构中) | ZStone 的管理节点 IP | 4.10.6 | |
logInPort (可选) | int | body(包含在params 结构中) | ZStone 登录服务端口 | 4.10.6 | |
apiPort (可选) | int | body(包含在params 结构中) | ZStone API 服务端口 | 4.10.6 | |
logInUrl (可选) | String | body(包含在params 结构中) | ZStone 登录使用 URL | 4.10.6 | |
resourceUuid (可选) | String | body(包含在params 结构中) | 资源UUID | 4.10.6 | |
tagUuids (可选) | List | body(包含在params 结构中) | 标签UUID列表 | 4.10.6 | |
systemTags (可选) | List | body | 系统标签 | 4.10.6 | |
userTags (可选) | List | body | 用户标签 | 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" } }
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
success | boolean | 创建是否成功 | 4.10.6 |
error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.10.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 4.10.0 |
description | String | 错误的概要描述 | 4.10.0 |
details | String | 错误的详细信息 | 4.10.0 |
elaboration | String | 保留字段,默认为null | 4.10.0 |
opaque | LinkedHashMap | 保留字段,默认为null | 4.10.0 |
cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为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-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/zstone-plugin/53c0433a817349f89f66532addeb8b6c
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
---|---|---|---|---|---|
uuid | String | url | ZStone 的 UUID,唯一标示该资源 | 4.10.6 | |
deleteMode (可选) | String | body | 删除模式(Permissive / Enforcing,Permissive) | 4.10.6 | |
systemTags (可选) | List | body | 系统标签 | 4.10.6 | |
userTags (可选) | List | body | 用户标签 | 4.10.6 |
{}
,出错时返回的JSON结构包含一个error字段,例如:{ "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/cluster
Authorization: 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": [] }
systemTags
、userTags
字段可以省略。列出是为了表示body中可以包含这两个字段。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
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
---|---|---|---|---|---|
uuid | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的 UUID,唯一标示该资源 | 4.10.6 | |
clusterName | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的集群名称 | 4.10.6 | |
managementIp (可选) | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的管理节点 IP | 4.10.6 | |
chronyIp | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的时间同步服务器 IP | 4.10.6 | |
publicNetworkCidr | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的公有网络 IP CIDR | 4.10.6 | |
clusterNetworkCidr | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的集群使用网络 IP CIDR | 4.10.6 | |
managementNetworkCidrv | String | body(包含在updateZStoneClusterConfig 结构中) | ZStone 的管理网络 IP CIDR | 4.10.6 | |
systemTags (可选) | List | body | 系统标签 | 4.10.6 | |
userTags (可选) | List | body | 用户标签 | 4.10.6 | |
force (可选) | boolean | body(包含在updateZStoneClusterConfig 结构中) | 是否强制添加 ZStone 集群. 一般情况下, ZStone 已有集群后再添加集群会出现意想不到的问题, 因此这里做了防呆 | 4.10.7 |
{}
,出错时返回的JSON结构包含一个error字段,例如:{ "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.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; UpdateZStoneClusterConfigAction.Result res = action.call();
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()
学习路径
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1ZStack学院:
training@zstack.io业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io下载链接已发送至您的邮箱。
如未收到,请查看您的垃圾邮件、订阅邮件、广告邮件。 当您收到电子邮件后,请点击 URL 链接,以完成下载。感谢您使用 ZStack 产品和服务。
成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
信息提交成功。
我们将安排工作人员尽快与您取得联系,请保持电话畅通。感谢您使用 ZStack 产品和服务。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。