POST zstack/v1/vips
Authorization: OAuth the-session-uuid
{
"params": {
"name": "vip1",
"l3NetworkUuid": "15788630ef6644af99c5378edf4e54da",
"ipRangeUuid": "2e6e249189d83883aeb4c0fe79f82967",
"requiredIp": "10.0.0.2"
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"vip1","l3NetworkUuid":"b75e7bddf2803f6c85f8450b01262546","ipRangeUuid":"2e6e249189d83883aeb4c0fe79f82967","requiredIp":"10.0.0.2"}}' http://localhost:8080/zstack/v1/vips
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
---|---|---|---|---|---|
name | String | body(包含在params结构中) | 资源名称 | 0.6 | |
description (可选) | String | body(包含在params结构中) | 资源的详细描述 | 0.6 | |
l3NetworkUuid | String | body(包含在params结构中) | 使用虚拟IP网络服务的三层网络UUID | 0.6 | |
ipRangeUuid (可选) | String | body(包含在params结构中) | IP段UUID | 3.9.0 | |
allocatorStrategy (可选) | String | body(包含在params结构中) | 分配策略 |
| 0.6 |
requiredIp (可选) | String | body(包含在params结构中) | 请求的IP | 0.6 | |
resourceUuid (可选) | String | body(包含在params结构中) | 资源UUID | 0.6 | |
systemTags (可选) | List | body | 系统标签 | 0.6 | |
userTags (可选) | List | body | 用户标签 | 0.6 |
{
"inventory": {
"uuid": "45a2700283f039a39f40100505a68609",
"name": "vip1",
"ipRangeUuid": "da8d443f5c923c969118721845891d53",
"l3NetworkUuid": "e43b5613fd8039ee888cca53dae87341",
"ip": "192.168.0.1",
"state": "Enabled",
"gateway": "127.0.0.1",
"netmask": "255.255.0.0",
"peerL3NetworkUuids": [
"1f970d11e2be3b0da5ad65cd4d20a549"
],
"system": false
}
}
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
inventory | VipInventory | 详情参考inventory | 0.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
description | String | 错误的概要描述 | 0.6 |
details | String | 错误的详细信息 | 0.6 |
elaboration | String | 保留字段,默认为null | 0.6 |
opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
name | String | 资源名称 | 0.6 |
description | String | 资源的详细描述 | 0.6 |
l3NetworkUuid | String | 使用虚拟IP网络服务的三层网络UUID | 0.6 |
ip | String | IPv4类型的IP地址 | 0.6 |
state | String | 状态(启用,禁用) | 0.6 |
gateway | String | 网关 | 0.6 |
netmask | String | 子网掩码 | 0.6 |
prefixLen | Integer | 掩码长度 | 3.1.0 |
serviceProvider | String | 提供VIP服务的服务提供者 | 0.6 |
peerL3NetworkUuids | List | 提供VIP服务的L3网络UUID | 0.6 |
useFor | String | 用途,例如:端口转发 | 0.6 |
system | boolean | 是否系统创建 | 3.9.0 |
createDate | Timestamp | 创建时间 | 0.6 |
lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
servicesRefs | List | 详情参考servicesRefs | 0.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
serviceType | String | 服务类型 | 3.9.0 |
vipUuid | String | VIP UUID | 3.9.0 |
createDate | Timestamp | 创建时间 | 3.9.0 |
lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
CreateVipAction action = new CreateVipAction();
action.name = "vip1";
action.l3NetworkUuid = "b75e7bddf2803f6c85f8450b01262546";
action.ipRangeUuid = "2e6e249189d83883aeb4c0fe79f82967";
action.requiredIp = "10.0.0.2";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVipAction.Result res = action.call();
CreateVipAction action = CreateVipAction()
action.name = "vip1"
action.l3NetworkUuid = "b75e7bddf2803f6c85f8450b01262546"
action.ipRangeUuid = "2e6e249189d83883aeb4c0fe79f82967"
action.requiredIp = "10.0.0.2"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVipAction.Result res = action.call()
DELETE zstack/v1/vips/{uuid}?deleteMode={deleteMode}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 191031ca5ac34d5e92e1a86cde878edf" \
-X DELETE http://localhost:8080/zstack/v1/vips/38791fa2927b459cbeff033db96c3479?deleteMode=Permissive
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
---|---|---|---|---|---|
uuid | String | url | 资源的UUID,唯一标示该资源 | 0.6 | |
deleteMode (可选) | String | body | 删除模式 | 0.6 | |
systemTags (可选) | List | body | 系统标签 | 0.6 | |
userTags (可选) | List | body | 用户标签 | 0.6 |
{}
,出错时返回的JSON结构包含一个error字段,例如:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
DeleteVipAction action = new DeleteVipAction();
action.uuid = "8da4c26b4089423f93cbce8ab804f9e9";
action.deleteMode = "Permissive";
action.sessionId = "772f7846b7c24d9b933deb8b03fc3024";
DeleteVipAction.Result res = action.call();
DeleteVipAction action = DeleteVipAction()
action.uuid = "addc2d7cb578402f9ce1569402338c1b"
action.deleteMode = "Permissive"
action.sessionId = "429360288ef140afaeb86961b638ea62"
DeleteVipAction.Result res = action.call()
GET zstack/v1/vips
GET zstack/v1/vips/{uuid}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth fbe1443215334b0aa609b5417f5f36ab" \
-X GET http://localhost:8080/zstack/v1/vips?q=uuid=ba1cf7be9f20433fa5091bec091ba22d
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 39036aee2ef641afac5b253aae2377be" \
-X GET http://localhost:8080/zstack/v1/vips/a077653982cb422daa06e6c2d840b140
可查询字段
运行zstack-cli命令行工具,输入QueryVip
并按Tab键查看所有可查询字段以及可跨表查询的资源名。
{
"inventories": [
{
"uuid": "8c5eb4938be549218fda4c87de4d8cad",
"name": "new name",
"ipRangeUuid": "7d0dda5b1c4f40069ec4cfd6b66bdf48",
"l3NetworkUuid": "a81054a6807e47a09922473e9ab376cb",
"ip": "192.168.0.1",
"state": "Enabled",
"gateway": "127.0.0.1",
"netmask": "255.255.0.0",
"peerL3NetworkUuid": [
"64ef7a2ea9ec4095b343ea239a7ba344"
]
}
]
}
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
inventories | List | 详情参考inventories | 0.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
description | String | 错误的概要描述 | 0.6 |
details | String | 错误的详细信息 | 0.6 |
elaboration | String | 保留字段,默认为null | 0.6 |
opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
name | String | 资源名称 | 0.6 |
description | String | 资源的详细描述 | 0.6 |
l3NetworkUuid | String | 三层网络UUID | 0.6 |
ip | String | IPv4类型的IP地址 | 0.6 |
state | String | 状态(启用,禁用) | 0.6 |
gateway | String | 网关 | 0.6 |
netmask | String | 子网掩码 | 0.6 |
prefixLen | String | 掩码长度 | 3.1.0 |
serviceProvider | String | 提供VIP服务的服务提供者 | 0.6 |
peerL3NetworkUuid | String | L3网络UUID | 0.6 |
useFor | String | 用途,例如:端口转发 | 0.6 |
createDate | Timestamp | 创建时间 | 0.6 |
lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
QueryVipAction action = new QueryVipAction();
action.conditions = asList("uuid=0a573b1c687246ff970c04ef5d0eaf07");
action.sessionId = "bf2f206d12d742d3a9182ea663e12265";
QueryVipAction.Result res = action.call();
QueryVipAction action = QueryVipAction()
action.conditions = ["uuid=5a3bf1e979944ea4a958fdac5a8bcef2"]
action.sessionId = "bc563fd71d014e84a49f1d280ef020ff"
QueryVipAction.Result res = action.call()
学习路径
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io下载链接已发送至您的邮箱。
如未收到,请查看您的垃圾邮件、订阅邮件、广告邮件。 当您收到电子邮件后,请点击 URL 链接,以完成下载。感谢您使用 ZStack 产品和服务。
成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
立即体验
联系我们
回到顶部
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。