POST zstack/v1/vpc/virtual-routers
Authorization: OAuth the-session-uuid
{
"params": {
"name": "TestVPC",
"virtualRouterOfferingUuid": "d9a495f730564ce58328dbfdb1d05721",
"description": "this is a vpc for test"
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"TestVPC","virtualRouterOfferingUuid":"81e8c1f14a6e352884e6941c4a2de95a","description":"this is a vpc for test"}}' \
http://localhost:8080/zstack/v1/vpc/virtual-routers
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
---|---|---|---|---|---|
name | String | body(包含在params结构中) | 资源名称 | 2.3 | |
virtualRouterOfferingUuid | String | body(包含在params结构中) | 云路由规格 | 2.3 | |
description (可选) | String | body(包含在params结构中) | 资源的详细描述 | 2.3 | |
resourceUuid (可选) | String | body(包含在params结构中) | 资源的UUID | 2.3 | |
systemTags (可选) | List | body | 系统标签 | 2.3 | |
userTags (可选) | List | body | 用户标签 | 2.3 |
haUuid::HA_GROUP_UUID
haUuid::e2af8f869eff49d2a3d6f86cadc27090
staticVip::L3UUID::IP
,L3UUID为云路由规格中的公网UUID,IP为用户指定的公网IP。staticVip::4ed5cce4f55a43aca8e61ebbc0c3985d::172.20.1.1
resourceBindings::Cluster:clusterUuid
,其中clusterUuid为对应的集群uuidresourceBindings::Cluster:2sdasf231jvznsdak
{
"inventory": {
"applianceVmType": "vpcvrouter",
"managementNetworkUuid": "a01fad3eb1d14bd787b8830e1d287ee3",
"status": "Connected",
"agentPort": 7272.0,
"uuid": "4de286dcb34343a0b5dedaea96307c06",
"name": "TestVPC",
"description": "this is a vpc for test",
"zoneUuid": "88634bc51a1345b98058c1827999bd75",
"clusterUuid": "5ebca05bc3cf4d5b970ddb32b10455c0",
"imageUuid": "490043dfeb814b119f0f6c264ed6bb1e",
"hostUuid": "a19572ae4fcc4b7d8a090d06c99067fa",
"lastHostUuid": "d374797d2d01495cb4dedd9e452909d0",
"instanceOfferingUuid": "8fcc3c2b5e1b41e586ed07ffece475e4",
"rootVolumeUuid": "ed5b232109f64f0dbe3342ffa8924d14",
"platform": "Linux",
"defaultL3NetworkUuid": "2aedc4cd00f8495f8fc08c991dd7be4c",
"type": "ApplianceVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 4.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 9, 2017 4:20:39 PM",
"lastOpDate": "Nov 9, 2017 4:20:39 PM",
"state": "Running",
"vmNics": [
{
"uuid": "6c8b46eec225440bb7179b6c797937ed",
"vmInstanceUuid": "4de286dcb34343a0b5dedaea96307c06",
"usedIpUuid": "033b876b861f4b9abaf594a893c1c94f",
"l3NetworkUuid": "49e2d31895c94bf0808372360ebcae31",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Nov 9, 2017 4:20:39 PM",
"lastOpDate": "Nov 9, 2017 4:20:39 PM"
}
],
"allVolumes": [
{
"uuid": "ed5b232109f64f0dbe3342ffa8924d14",
"name": "Root-Volume-For-VM-4de286dcb34343a0b5dedaea96307c06",
"primaryStorageUuid": "c3f1cbaf9b014c1d8989ff940ed5593a",
"vmInstanceUuid": "4de286dcb34343a0b5dedaea96307c06",
"diskOfferingUuid": "93bfd802ebea486ab4ce071967235b76",
"rootImageUuid": "490043dfeb814b119f0f6c264ed6bb1e",
"installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-ed5b232109f64f0dbe3342ffa8924d14/ed5b232109f64f0dbe3342ffa8924d14.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 9, 2017 4:20:39 PM",
"lastOpDate": "Nov 9, 2017 4:20:39 PM"
}
]
}
}
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
inventory | VmInstanceInventory | 详情参考inventory | 2.3 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 2.3 |
description | String | 错误的概要描述 | 2.3 |
details | String | 错误的详细信息 | 2.3 |
elaboration | String | 保留字段,默认为null | 2.3 |
opaque | LinkedHashMap | 保留字段,默认为null | 2.3 |
cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 2.3 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
name | String | 资源名称 | 2.3 |
description | String | 资源的详细描述 | 2.3 |
zoneUuid | String | 区域UUID | 2.3 |
clusterUuid | String | 集群UUID | 2.3 |
imageUuid | String | 镜像UUID | 2.3 |
hostUuid | String | 物理机UUID | 2.3 |
lastHostUuid | String | 上一次运行云路由设备的物理机UUID | 2.3 |
instanceOfferingUuid | String | 计算规格UUID | 2.3 |
rootVolumeUuid | String | 根云盘UUID | 2.3 |
platform | String | 云路由设备运行平台 | 2.3 |
defaultL3NetworkUuid | String | 默认三层网络UUID | 2.3 |
type | String | 云路由设备类型 | 2.3 |
hypervisorType | String | 云路由设备的hypervisor类型 | 2.3 |
memorySize | Long | 内存大小 | 2.3 |
cpuNum | Integer | cpu数量 | 2.3 |
cpuSpeed | Long | cpu主频 | 2.3 |
allocatorStrategy | String | 分配策略 | 2.3 |
createDate | Timestamp | 创建时间 | 2.3 |
lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
state | String | 云路由设备的可用状态 | 2.3 |
vmNics | List | 详情参考vmNics | 2.3 |
allVolumes | List | 详情参考allVolumes | 2.3 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
vmInstanceUuid | String | 云主机UUID | 2.3 |
l3NetworkUuid | String | 三层网络UUID | 2.3 |
ip | String | ip地址 | 2.3 |
mac | String | mac地址 | 2.3 |
netmask | String | 子网掩码 | 2.3 |
gateway | String | 网关 | 2.3 |
metaData | String | 内部使用的保留域 | 2.3 |
deviceId | Integer | 设备ID
| 2.3 |
createDate | Timestamp | 创建时间 | 2.3 |
lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
name | String | 资源名称 | 2.3 |
description | String | 资源的详细描述 | 2.3 |
primaryStorageUuid | String | 主存储UUID | 2.3 |
vmInstanceUuid | String | 云主机UUID | 2.3 |
diskOfferingUuid | String | 云盘规格UUID | 2.3 |
rootImageUuid | String | 根云盘镜像UUID | 2.3 |
installPath | String | 安装路径 | 2.3 |
type | String | 云盘类型 | 2.3 |
format | String | 云盘格式 | 2.3 |
size | Long | 云盘虚拟容量 | 2.3 |
actualSize | Long | 云盘实际容量 | 2.3 |
deviceId | Integer | 设备ID | 2.3 |
state | String | 云盘的可用状态 | 2.3 |
status | String | 云盘的连接状态 | 2.3 |
createDate | Timestamp | 创建时间 | 2.3 |
lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
isShareable | Boolean | 云盘是否共享 | 2.3 |
CreateVpcVRouterAction action = new CreateVpcVRouterAction();
action.name = "TestVPC";
action.virtualRouterOfferingUuid = "c9cfb57035294ff4abeb400922f50d09";
action.description = "this is a vpc for test";
action.sessionId = "41652c67906143948e1fecc1054b65bd";
CreateVpcVRouterAction.Result res = action.call();
CreateVpcVRouterAction action = CreateVpcVRouterAction()
action.name = "TestVPC"
action.virtualRouterOfferingUuid = "a7eaafd48945481fa2d9a35032b8770b"
action.description = "this is a vpc for test"
action.sessionId = "9d1cc409dd8b47d3aa4ead7bccf875f2"
CreateVpcVRouterAction.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 产品和服务。