VPC相关接口
创建VPC路由器(CreateVpcVRouter)
API请求
URLs
POST zstack/v1/vpc/virtual-routersHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "TestVPC",
"virtualRouterOfferingUuid": "81e8c1f14a6e352884e6941c4a2de95a",
"description": "this is a vpc for test"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
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.2.2 | |
| virtualRouterOfferingUuid | String | body(包含在params结构中) | 云路由规格 | 2.2.2 | |
| description (可选) | String | body(包含在params结构中) | 资源的详细描述 | 2.2.2 | |
| resourceUuid (可选) | String | body(包含在params结构中) | 资源的UUID | 2.2.2 | |
| systemTags (可选) | List | body | 2.2.2 | ||
| userTags (可选) | List | body | 2.2.2 | ||
| zoneUuid (可选) | String | body(包含在params结构中) | 区域UUID | 3.10.0 | |
| clusterUuid (可选) | String | body(包含在params结构中) | 集群UUID | 3.10.0 | |
| hostUuid (可选) | String | body(包含在params结构中) | 物理机UUID | 3.10.0 | |
| primaryStorageUuidForRootVolume (可选) | String | body(包含在params结构中) | 主存储UUID。若指定,路由器的根云盘会在指定主存储创建 | 4.4.24 | |
| rootVolumeSystemTags (可选) | List | body(包含在params结构中) | 路由器根盘所需要的系统标签 | 4.4.24 | |
| tagUuids (可选) | List | body(包含在params结构中) | 标签UUID列表 | 0.6 |
Note:
- ZStack Cloud创建VPC路由器时支持记录VPC路由器是否已加入高可用组功能,SystemTags增加haUuid选项。
- 选项格式为:
haUuid::HA_GROUP_UUID - 例如:
haUuid::e2af8f869eff49d2a3d6f86cadc27090
- 选项格式为:
- ZStack Cloud创建VPC路由器时支持指定公网IP创建VPC路由器功能,SystemTags增加staticVip选项。
- 选项格式为:
staticVip::L3UUID::IP,L3UUID为路由器规格中的公网UUID,IP为用户指定的公网IP。 - 例如:
staticVip::4ed5cce4f55a43aca8e61ebbc0c3985d::172.20.1.1 - ZStack Cloud创建VPC路由器时支持设置跨集群高可用策略,SystemTags增加resourceBindings选项。
- 选项格式为:
resourceBindings::Cluster:clusterUuid,其中clusterUuid为对应的集群uuid - 例如:
resourceBindings::Cluster:2sdasf231jvznsdak
- 选项格式为:
- 选项格式为:
API返回
返回示例
{
"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": "/Cloud_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"
}
]
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
| inventory | VmInstanceInventory | 详情参考inventory | 2.3 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
| architecture | 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 |
| guestOsType | String | 2.3 | |
| vmNics | List | 详情参考vmNics | 2.3 |
| allVolumes | List | 详情参考allVolumes | 2.3 |
| vmCdRoms | List | 详情参考vmCdRoms | 2.3 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
| hypervisorType | String | 2.3 | |
| netmask | String | 子网掩码 | 2.3 |
| gateway | String | 网关 | 2.3 |
| metaData | String | 内部使用的保留域 | 2.3 |
| deviceId | Integer | 设备ID
|
2.3 |
| deviceId | Integer | 2.3 | |
| type | String | 2.3 | |
| internalName | String | 2.3 | |
| createDate | Timestamp | 创建时间 | 2.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
| usedIps | List | 详情参考usedIps | 2.3 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
| ipRangeUuid | String | IP段UUID | 2.3 |
| l3NetworkUuid | String | 三层网络UUID | 2.3 |
| ipVersion | Integer | 2.3 | |
| ip | String | 2.3 | |
| netmask | String | 2.3 | |
| gateway | String | 2.3 | |
| usedFor | String | 2.3 | |
| ipInLong | long | 2.3 | |
| vmNicUuid | String | 云主机网卡UUID | 2.3 |
| createDate | Timestamp | 创建时间 | 2.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
| volumeQos | String | 2.3 | |
| lastDetachDate | Timestamp | 2.3 | |
| lastVmInstanceUuid | String | 2.3 | |
| isShareable | Boolean | 云盘是否共享 | 2.3 |
#vmCdRoms
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| deviceId | Integer | 0.6 | |
| isoUuid | String | 0.6 | |
| isoInstallPath | String | 0.6 | |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
SDK示例
Java
SDK
CreateVpcVRouterAction action = new CreateVpcVRouterAction();
action.name = "TestVPC";
action.virtualRouterOfferingUuid = "81e8c1f14a6e352884e6941c4a2de95a";
action.description = "this is a vpc for test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVpcVRouterAction.Result res = action.call();Python
SDK
CreateVpcVRouterAction action = CreateVpcVRouterAction()
action.name = "TestVPC"
action.virtualRouterOfferingUuid = "81e8c1f14a6e352884e6941c4a2de95a"
action.description = "this is a vpc for test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVpcVRouterAction.Result res = action.call()查询VPC路由器(QueryVpcRouter)
API请求
URLs
GET zstack/v1/vpc/virtual-routers
GET zstack/v1/vpc/virtual-routers/{uuid}Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers?q=name=vpcRoutercurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers/205d11a687d03b46852d4d24fc85ae75可查询字段
运行CLI命令行工具,输入QueryVpcRouter并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"dns": [
{
"vpcRouterUuid": "4183325c367d384a84458f89c35d62a8",
"dns": "8.8.8.8"
}
],
"uuid": "4183325c367d384a84458f89c35d62a8",
"name": "Test-VM",
"description": "web server VM",
"zoneUuid": "77689ed989253db0bb5863b103e06ecd",
"clusterUuid": "7f124c177f1535cebca9b0a555998e8e",
"imageUuid": "9e0eaf2e7ea93bc0bfc9f22d3f7328cd",
"hostUuid": "72547613a0bf320caca7a149d99e3ed4",
"lastHostUuid": "9e54bc8261f6396db6c66eb8a76e246d",
"instanceOfferingUuid": "e115b1542d2e35c8b9fbb5afd9fd067c",
"rootVolumeUuid": "48afbfcc2d36391586f7b6b44df93712",
"platform": "Linux",
"defaultL3NetworkUuid": "70dc6311679638c0a1e323d583332463",
"type": "UserVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 1.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running",
"vmNics": [
{
"uuid": "df1eae8361983c86a46d3d922ad0a6f4",
"vmInstanceUuid": "4183325c367d384a84458f89c35d62a8",
"usedIpUuid": "2bdc1a927ebb34f89a880d8aefc7c763",
"l3NetworkUuid": "70dc6311679638c0a1e323d583332463",
"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 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "48afbfcc2d36391586f7b6b44df93712",
"name": "Root-Volume-For-VM-4183325c367d384a84458f89c35d62a8",
"primaryStorageUuid": "a33d58803a2a307bb1762b9209e64ba2",
"vmInstanceUuid": "4183325c367d384a84458f89c35d62a8",
"diskOfferingUuid": "c762d59a3e6f36d89bff2ce3ea4b864c",
"rootImageUuid": "9e0eaf2e7ea93bc0bfc9f22d3f7328cd",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-48afbfcc2d36391586f7b6b44df93712/48afbfcc2d36391586f7b6b44df93712.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventories | List | 详情参考inventories | 0.6 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| publicNetworkUuid | String | 0.6 | |
| virtualRouterVips | List | 0.6 | |
| applianceVmType | String | 0.6 | |
| managementNetworkUuid | String | 0.6 | |
| defaultRouteL3NetworkUuid | String | 0.6 | |
| status | String | 0.6 | |
| agentPort | Integer | 0.6 | |
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| zoneUuid | String | 区域UUID | 0.6 |
| clusterUuid | String | 集群UUID | 0.6 |
| imageUuid | String | 镜像UUID | 0.6 |
| hostUuid | String | 物理机UUID | 0.6 |
| lastHostUuid | String | 0.6 | |
| instanceOfferingUuid | String | 计算规格UUID | 0.6 |
| rootVolumeUuid | String | 根云盘UUID | 0.6 |
| platform | String | 0.6 | |
| defaultL3NetworkUuid | String | 0.6 | |
| type | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| memorySize | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| cpuSpeed | Long | 0.6 | |
| allocatorStrategy | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| state | String | 0.6 | |
| dns | List | 详情参考dns | 2.4 |
| vmNics | List | 详情参考vmNics | 0.6 |
| allVolumes | List | 详情参考allVolumes | 0.6 |
#dns
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| vpcRouterUuid | String | 2.4 | |
| dns | String | 2.4 | |
| createDate | Timestamp | 创建时间 | 2.4 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.4 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| l3NetworkUuid | String | 三层网络UUID | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| primaryStorageUuid | String | 主存储UUID | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| diskOfferingUuid | String | 云盘规格UUID | 0.6 |
| rootImageUuid | String | 0.6 | |
| installPath | String | 0.6 | |
| type | String | 0.6 | |
| format | String | 0.6 | |
| size | Long | 0.6 | |
| actualSize | Long | 0.6 | |
| deviceId | Integer | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| isShareable | Boolean | 0.6 |
SDK示例
Java
SDK
QueryVpcRouterAction action = new QueryVpcRouterAction();
action.conditions = asList("name=vpcRouter");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVpcRouterAction.Result res = action.call();Python
SDK
QueryVpcRouterAction action = QueryVpcRouterAction()
action.conditions = ["name=vpcRouter"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVpcRouterAction.Result res = action.call()获取VPC路由器可加载的三层网络(GetAttachableVpcL3Network)
API请求
URLs
POST zstack/v1/vpc/virtual-routers/{uuid}/attachable-vpc-l3sHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/vpc/virtual-routers/417478f0b61732408176f16615ab6d32/attachable-vpc-l3s参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 2.3 | |
| systemTags (可选) | List | body | 系统标签 | 2.3 | |
| userTags (可选) | List | body | 用户标签 | 2.3 |
API返回
返回示例
{
"inventories": [
{
"uuid": "81c29ac529163ffa9d4f246d68518dd1",
"name": "test-l3",
"description": "test l3",
"type": "L3VpcNetwork",
"zoneUuid": "aea3c47aa8273399ac8827fbc78aae67",
"l2NetworkUuid": "cbba13d2e8273d529cfcb89c66d54fb2",
"system": false,
"category": "Private",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"ipRanges": [
{
"l3NetworkUuid": "cc5980d5c4173dd5b57dc1b28cdb0683",
"name": "test ip range",
"startIp": "100.64.0.10",
"endIp": "100.64.0.100",
"netmask": "255.255.255.0",
"gateway": "100.64.0.1",
"networkCidr": "100.64.0.0/24",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
| inventories | List | 详情参考inventories | 2.3 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
| name | String | 资源名称 | 2.3 |
| description | String | 资源的详细描述 | 2.3 |
| type | String | 三层网络类型 | 2.3 |
| zoneUuid | String | 区域UUID | 2.3 |
| l2NetworkUuid | String | 二层网络UUID | 2.3 |
| state | String | 三层网络的可用状态 | 2.3 |
| dnsDomain | String | DNS域 | 2.3 |
| system | Boolean | 是否用于系统云主机 | 2.3 |
| category | String | 网络类型,需要与system标签搭配使用,system为true时可设置为Public、Private | 2.3 |
| createDate | Timestamp | 创建时间 | 2.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
| dns | List | 域名解析服务器 | 2.3 |
| ipRanges | List | 详情参考ipRanges | 2.3 |
| networkServices | List | 详情参考networkServices | 2.3 |
| hostRoute | List | 详情参考hostRoute |
#ipRanges
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 2.3 |
| l3NetworkUuid | String | 三层网络UUID | 2.3 |
| name | String | 资源名称 | 2.3 |
| description | String | 资源的详细描述 | 2.3 |
| startIp | String | 起始ip | 2.3 |
| endIp | String | 结束ip | 2.3 |
| netmask | String | 子网掩码 | 2.3 |
| gateway | String | 网关 | 2.3 |
| networkCidr | String | CIDR范围 | 2.3 |
| createDate | Timestamp | 创建时间 | 2.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
#networkServices
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| l3NetworkUuid | String | 三层网络UUID | 2.3 |
| networkServiceProviderUuid | String | 网络服务提供模块UUID | 2.3 |
| networkServiceType | String | 网络服务类型 | 2.3 |
#hostRoute
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 2.3 | |
| l3NetworkUuid | String | 三层网络UUID | 2.3 |
| prefix | String | 2.3 | |
| nexthop | String | 2.3 | |
| createDate | Timestamp | 创建时间 | 2.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.3 |
SDK示例
Java
SDK
GetAttachableVpcL3NetworkAction action = new GetAttachableVpcL3NetworkAction();
action.uuid = "417478f0b61732408176f16615ab6d32";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAttachableVpcL3NetworkAction.Result res = action.call();Python
SDK
GetAttachableVpcL3NetworkAction action = GetAttachableVpcL3NetworkAction()
action.uuid = "417478f0b61732408176f16615ab6d32"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetAttachableVpcL3NetworkAction.Result res = action.call()获取实时流量状态(GetVpcVRouterDistributedRoutingConnections)
获取VPC路由器实时流量状态。
API请求
URLs
GET zstack/v1/vpc/virtual-routers/{uuid}/tracked-connectionsHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers/f37467649dca3ee8a0ddad0b856a8df6/tracked-connections参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源。需要开启分布式路由,才能获取到VPC路由器实时流量状态。 | 2.3 | |
| systemTags (可选) | List | query | 系统标签 | 2.3 | |
| userTags (可选) | List | query | 用户标签 | 2.3 |
API返回
返回示例
{
"inventories": {
"192.168.31.156,192.168.105.175": {
"sourceL2NetworkType": "L2VlanNetwork",
"destinationL2NetworkType": "L2VlanNetwork",
"sourceMac": "fa:bf:6e:37:c3:00",
"destinationMac": "fa:3a:b3:ae:f4:00",
"sourceL2NetworkVni": 3101.0,
"destinationL2NetworkVni": 3105.0,
"lastOpDate": "2017-12-02 15:23:44.872099448 +0800 CST m\u003d+70467.712498312",
"status": "ZSNP_DST_SUCC"
}
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| inventories | Map | 实时流量状态集合,结构为Map
|
2.3 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
SDK示例
Java
SDK
GetVpcVRouterDistributedRoutingConnectionsAction action = new GetVpcVRouterDistributedRoutingConnectionsAction();
action.uuid = "f37467649dca3ee8a0ddad0b856a8df6";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVpcVRouterDistributedRoutingConnectionsAction.Result res = action.call();Python
SDK
GetVpcVRouterDistributedRoutingConnectionsAction action = GetVpcVRouterDistributedRoutingConnectionsAction()
action.uuid = "f37467649dca3ee8a0ddad0b856a8df6"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVpcVRouterDistributedRoutingConnectionsAction.Result res = action.call()获取分布式路由是否打开(GetVpcVRouterDistributedRoutingEnabled)
获取VPC路由器分布式路由是否打开。
API请求
URLs
GET zstack/v1/vpc/virtual-routers/{uuid}/distributed-routingHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers/9fab45026c2239d884db36ce9190660f/distributed-routing参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 2.3 | |
| systemTags (可选) | List | query | 系统标签 | 2.3 | |
| userTags (可选) | List | query | 用户标签 | 2.3 |
API返回
返回示例
{
"enabled": true
}
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| enabled | boolean | 获取VPC路由器分布式路由是否打开 | 2.3 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
SDK示例
Java
SDK
GetVpcVRouterDistributedRoutingEnabledAction action = new GetVpcVRouterDistributedRoutingEnabledAction();
action.uuid = "9fab45026c2239d884db36ce9190660f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVpcVRouterDistributedRoutingEnabledAction.Result res = action.call();Python
SDK
GetVpcVRouterDistributedRoutingEnabledAction action = GetVpcVRouterDistributedRoutingEnabledAction()
action.uuid = "9fab45026c2239d884db36ce9190660f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVpcVRouterDistributedRoutingEnabledAction.Result res = action.call()设置分布式路由开关(SetVpcVRouterDistributedRoutingEnabled)
设置VPC路由器分布式路由开关。
API请求
URLs
POST zstack/v1/vpc/virtual-routers/{uuid}/distributed-routingHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"stateEvent": "enable"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/vpc/virtual-routers/fed6eb5e41d83512ba1f836b5473b4fc/distributed-routing参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 2.3 | |
| stateEvent | String | body(包含在params结构中) | 资源的可用状态 |
|
2.3 |
| systemTags (可选) | List | body | 系统标签 | 2.3 | |
| userTags (可选) | List | body | 用户标签 | 2.3 |
API返回
返回示例
{
"enabled": true
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| enabled | boolean | 设置VPC路由器分布式路由开关是否打开 | 2.3 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.3 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
SDK示例
Java
SDK
SetVpcVRouterDistributedRoutingEnabledAction action = new SetVpcVRouterDistributedRoutingEnabledAction();
action.uuid = "fed6eb5e41d83512ba1f836b5473b4fc";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVpcVRouterDistributedRoutingEnabledAction.Result res = action.call();Python
SDK
SetVpcVRouterDistributedRoutingEnabledAction action = SetVpcVRouterDistributedRoutingEnabledAction()
action.uuid = "fed6eb5e41d83512ba1f836b5473b4fc"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVpcVRouterDistributedRoutingEnabledAction.Result res = action.call()向VPC路由器添加DNS(AddDnsToVpcRouter)
API请求
URLs
POST zstack/v1/vpc/virtual-routers/{uuid}/dnsHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"dns": "8.8.8.8"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中
systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"dns":"8.8.8.8"}}' \
http://localhost:8080/zstack/v1/vpc/virtual-routers/a6b12587c0c93b50956c689cae6e4404/dns参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 2.4.0 | |
| dns | String | body(包含在params结构中) | 2.4.0 | ||
| resourceUuid (可选) | String | body(包含在params结构中) | 2.4.0 | ||
| systemTags (可选) | List | body | 2.4.0 | ||
| userTags (可选) | List | body | 2.4.0 |
API返回
返回示例
{
"inventory": {
"dns": [
{
"vpcRouterUuid": "8ddf2e00f7623bf38125744211f17c12",
"dns": "8.8.8.8"
}
],
"applianceVmType": "vpcvrouter",
"managementNetworkUuid": "363b0211294d3fe1af316723d18d54a3",
"status": "Connected",
"agentPort": 7272.0,
"uuid": "8ddf2e00f7623bf38125744211f17c12",
"name": "TestVPC",
"description": "this is a vpc for test",
"zoneUuid": "d3cd927aa5953371aa13b82688258c13",
"clusterUuid": "61a2077d121637a09f27f5d1926d545e",
"imageUuid": "09024d35eab63bc080dc0f0e7aa3fa5c",
"hostUuid": "092e3f1b71a53b01bcc2919fb31b43a3",
"lastHostUuid": "64eb21f707d53db4822602c3714fc69e",
"instanceOfferingUuid": "ec1a12c9f896392bb42757c02f24870c",
"rootVolumeUuid": "857592621b163444899c275b258d780c",
"platform": "Linux",
"defaultL3NetworkUuid": "ad1173e8e97e385a8d3aaec182ee1fc3",
"type": "ApplianceVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 4.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running",
"vmNics": [
{
"uuid": "e0ba27ddc8fe33e882cc15dc60dcd58e",
"vmInstanceUuid": "8ddf2e00f7623bf38125744211f17c12",
"usedIpUuid": "0aecfc23129a3b7395fbff6e5d17303c",
"l3NetworkUuid": "d3d2b9e10ce4376782ccf210ad62f49e",
"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 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "857592621b163444899c275b258d780c",
"name": "Root-Volume-For-VM-8ddf2e00f7623bf38125744211f17c12",
"primaryStorageUuid": "1b880ac4a03e3ce0859b52e4c4274e76",
"vmInstanceUuid": "8ddf2e00f7623bf38125744211f17c12",
"diskOfferingUuid": "37537d10d728350687d0739141dd4b42",
"rootImageUuid": "09024d35eab63bc080dc0f0e7aa3fa5c",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-857592621b163444899c275b258d780c/857592621b163444899c275b258d780c.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
}#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| publicNetworkUuid | String | 0.6 | |
| virtualRouterVips | List | 0.6 | |
| applianceVmType | String | 0.6 | |
| managementNetworkUuid | String | 0.6 | |
| defaultRouteL3NetworkUuid | String | 0.6 | |
| status | String | 0.6 | |
| agentPort | Integer | 0.6 | |
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| zoneUuid | String | 区域UUID | 0.6 |
| clusterUuid | String | 集群UUID | 0.6 |
| imageUuid | String | 镜像UUID | 0.6 |
| hostUuid | String | 物理机UUID | 0.6 |
| lastHostUuid | String | 0.6 | |
| instanceOfferingUuid | String | 计算规格UUID | 0.6 |
| rootVolumeUuid | String | 根云盘UUID | 0.6 |
| platform | String | 0.6 | |
| defaultL3NetworkUuid | String | 0.6 | |
| type | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| memorySize | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| cpuSpeed | Long | 0.6 | |
| allocatorStrategy | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| state | String | 0.6 | |
| dns | List | 详情参考dns | 2.4 |
| vmNics | List | 详情参考vmNics | 0.6 |
| allVolumes | List | 详情参考allVolumes | 0.6 |
#dns
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| vpcRouterUuid | String | 2.4 | |
| dns | String | 2.4 | |
| createDate | Timestamp | 创建时间 | 2.4 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.4 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| l3NetworkUuid | String | 三层网络UUID | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| primaryStorageUuid | String | 主存储UUID | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| diskOfferingUuid | String | 云盘规格UUID | 0.6 |
| rootImageUuid | String | 0.6 | |
| installPath | String | 0.6 | |
| type | String | 0.6 | |
| format | String | 0.6 | |
| size | Long | 0.6 | |
| actualSize | Long | 0.6 | |
| deviceId | Integer | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| isShareable | Boolean | 0.6 |
SDK示例
Java
SDK
AddDnsToVpcRouterAction action = new AddDnsToVpcRouterAction();
action.uuid = "a6b12587c0c93b50956c689cae6e4404";
action.dns = "8.8.8.8";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddDnsToVpcRouterAction.Result res = action.call();Python
SDK
AddDnsToVpcRouterAction action = AddDnsToVpcRouterAction()
action.uuid = "a6b12587c0c93b50956c689cae6e4404"
action.dns = "8.8.8.8"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddDnsToVpcRouterAction.Result res = action.call()从VPC路由器移除DNS(RemoveDnsFromVpcRouter)
API请求
URLs
DELETE zstack/v1/vpc/virtual-routers/{uuid}/dns?dns={dns}
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vpc/virtual-routers/704e0c0e0fd23566bfac3416fb5cd5dd/dns?dns=8.8.4.4参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 0.6 | |
| dns | String | url | 0.6 | ||
| systemTags (可选) | List | body | 0.6 | ||
| userTags (可选) | List | body | 0.6 |
API返回
返回示例
{
"inventory": {
"dns": [
{
"vpcRouterUuid": "67a8f5c346923086bff064bc332dee1f",
"dns": "8.8.8.8"
}
],
"applianceVmType": "vpcvrouter",
"managementNetworkUuid": "8afbedef6a8c3c44b0da74ac251c8710",
"status": "Connected",
"agentPort": 7272.0,
"uuid": "67a8f5c346923086bff064bc332dee1f",
"name": "TestVPC",
"description": "this is a vpc for test",
"zoneUuid": "ed322832de35346e83ee3af58ae0ba1f",
"clusterUuid": "8152b3dd20ad39eab72feeb39b54bd5a",
"imageUuid": "d9f78c772d123b72b423f2d38d177404",
"hostUuid": "2936a13adb2d321aaf2f8a6bad17b512",
"lastHostUuid": "dc046362b4903f87b4cf99a31bf8b0c0",
"instanceOfferingUuid": "d0656359210c3448baaedb3284a59607",
"rootVolumeUuid": "7df4d03d3f773176b84d0015b26eba3a",
"platform": "Linux",
"defaultL3NetworkUuid": "91fce38c41e83adcbd1a2ddc7a657a68",
"type": "ApplianceVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 4.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running",
"vmNics": [
{
"uuid": "13f3d555d0083171b02f542e359699b6",
"vmInstanceUuid": "67a8f5c346923086bff064bc332dee1f",
"usedIpUuid": "da61650287ed32238b557d6c11c245d5",
"l3NetworkUuid": "27fc48db6d34311e9a68c61c4f7737b1",
"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 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "7df4d03d3f773176b84d0015b26eba3a",
"name": "Root-Volume-For-VM-67a8f5c346923086bff064bc332dee1f",
"primaryStorageUuid": "e274d0516c1432bdbc9187a95f03958b",
"vmInstanceUuid": "67a8f5c346923086bff064bc332dee1f",
"diskOfferingUuid": "f36042caf77835b0912e008a1ff49d88",
"rootImageUuid": "d9f78c772d123b72b423f2d38d177404",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-7df4d03d3f773176b84d0015b26eba3a/7df4d03d3f773176b84d0015b26eba3a.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
}#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| publicNetworkUuid | String | 0.6 | |
| virtualRouterVips | List | 0.6 | |
| applianceVmType | String | 0.6 | |
| managementNetworkUuid | String | 0.6 | |
| defaultRouteL3NetworkUuid | String | 0.6 | |
| status | String | 0.6 | |
| agentPort | Integer | 0.6 | |
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| zoneUuid | String | 区域UUID | 0.6 |
| clusterUuid | String | 集群UUID | 0.6 |
| imageUuid | String | 镜像UUID | 0.6 |
| hostUuid | String | 物理机UUID | 0.6 |
| lastHostUuid | String | 0.6 | |
| instanceOfferingUuid | String | 计算规格UUID | 0.6 |
| rootVolumeUuid | String | 根云盘UUID | 0.6 |
| platform | String | 0.6 | |
| defaultL3NetworkUuid | String | 0.6 | |
| type | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| memorySize | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| cpuSpeed | Long | 0.6 | |
| allocatorStrategy | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| state | String | 0.6 | |
| dns | List | 详情参考dns | 2.4 |
| vmNics | List | 详情参考vmNics | 0.6 |
| allVolumes | List | 详情参考allVolumes | 0.6 |
#dns
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| vpcRouterUuid | String | 2.4 | |
| dns | String | 2.4 | |
| createDate | Timestamp | 创建时间 | 2.4 |
| lastOpDate | Timestamp | 最后一次修改时间 | 2.4 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| l3NetworkUuid | String | 三层网络UUID | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| primaryStorageUuid | String | 主存储UUID | 0.6 |
| vmInstanceUuid | String | 云主机UUID | 0.6 |
| diskOfferingUuid | String | 云盘规格UUID | 0.6 |
| rootImageUuid | String | 0.6 | |
| installPath | String | 0.6 | |
| type | String | 0.6 | |
| format | String | 0.6 | |
| size | Long | 0.6 | |
| actualSize | Long | 0.6 | |
| deviceId | Integer | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| isShareable | Boolean | 0.6 |
SDK示例
Java
SDK
RemoveDnsFromVpcRouterAction action = new RemoveDnsFromVpcRouterAction();
action.uuid = "704e0c0e0fd23566bfac3416fb5cd5dd";
action.dns = "8.8.4.4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveDnsFromVpcRouterAction.Result res = action.call();Python
SDK
RemoveDnsFromVpcRouterAction action = RemoveDnsFromVpcRouterAction()
action.uuid = "704e0c0e0fd23566bfac3416fb5cd5dd"
action.dns = "8.8.4.4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveDnsFromVpcRouterAction.Result res = action.call()获取VPC路由器的网络服务状态(GetVpcVRouterNetworkServiceState)
API请求
URLs
GET zstack/v1/vpc/virtual-routers/{uuid}/networkservicestateHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers/51d5917daba83390978604d7b9c8c13a/networkservicestate?networkService=SNAT参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.4.0 | |
| networkService | String | query | 路由器提供的网络服务 |
|
3.4.0 |
| systemTags (可选) | List | query | 路由器的系统标签 | 3.4.0 | |
| userTags (可选) | List | query | 路由器的用户标签 | 3.4.0 |
Note:
- ZStack Cloud获取VPC路由器的网络服务状态时支持打开关闭VPC路由器的SNAT的服务,SystemTags增加disabledService选项。
- 选项格式为:
disabledService::SNAT - 例如:
disabledService::SNAT -
SystemTag没有
resourceType::VirtualRouterVmVO的VPC路由器则是表示开启SNAT功能,有此flag表示关闭SNAT功能。
- 选项格式为:
API返回
返回示例
{
"state": "enable"
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| state | String | 3.4.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.4.0 |
| description | String | 错误的概要描述 | 3.4.0 |
| details | String | 错误的详细信息 | 3.4.0 |
| elaboration | String | 保留字段,默认为null | 3.4.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.4.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.4.0 |
SDK示例
Java
SDK
GetVpcVRouterNetworkServiceStateAction action = new GetVpcVRouterNetworkServiceStateAction();
action.uuid = "51d5917daba83390978604d7b9c8c13a";
action.networkService = "SNAT";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVpcVRouterNetworkServiceStateAction.Result res = action.call();Python
SDK
GetVpcVRouterNetworkServiceStateAction action = GetVpcVRouterNetworkServiceStateAction()
action.uuid = "51d5917daba83390978604d7b9c8c13a"
action.networkService = "SNAT"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVpcVRouterNetworkServiceStateAction.Result res = action.call()设置VPC路由器的网络服务(SetVpcVRouterNetworkServiceState)
API请求
URLs
POST zstack/v1/vpc/virtual-routers/{uuid}/networkservicestateHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"networkService": "SNAT",
"state": "enable"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"networkService":"SNAT","state":"enable"}}' http://localhost:8080/zstack/v1/vpc/virtual-routers/824ad6ab1b5a3bd1ad935fa098d77826/networkservicestate参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.4.0 | |
| networkService | String | body(包含在params结构中) | 路由器提供的网络服务 |
|
3.4.0 |
| state | String | body(包含在params结构中) | 服务状态 |
|
3.4.0 |
| systemTags (可选) | List | body | 路由器的系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 路由器的用户标签 | 3.4.0 |
Note:
- ZStack Cloud获取VPC路由器的网络服务状态时支持打开关闭VPC路由器的SNAT的服务,SystemTags增加disabledService选项。
- 选项格式为:
disabledService::SNAT - 例如:
disabledService::SNAT -
SystemTag没有
resourceType::VirtualRouterVmVO的VPC路由器则是表示开启SNAT功能,有此flag表示关闭SNAT功能。
- 选项格式为:
API返回
返回示例
{
"state": "enable"
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| state | String | 3.4.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.4.0 |
| description | String | 错误的概要描述 | 3.4.0 |
| details | String | 错误的详细信息 | 3.4.0 |
| elaboration | String | 保留字段,默认为null | 3.4.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.4.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.4.0 |
SDK示例
Java
SDK
SetVpcVRouterNetworkServiceStateAction action = new SetVpcVRouterNetworkServiceStateAction();
action.uuid = "824ad6ab1b5a3bd1ad935fa098d77826";
action.networkService = "SNAT";
action.state = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVpcVRouterNetworkServiceStateAction.Result res = action.call();Python
SDK
SetVpcVRouterNetworkServiceStateAction action = SetVpcVRouterNetworkServiceStateAction()
action.uuid = "824ad6ab1b5a3bd1ad935fa098d77826"
action.networkService = "SNAT"
action.state = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVpcVRouterNetworkServiceStateAction.Result res = action.call()更新高可用组仲裁ip(ChangeVpcHaGroupMonitorIps)
API请求
URLs
PUT zstack/v1/vpc/hagroups/{uuid}/monitorIpsHeaders
Authorization: OAuth the-session-uuidBody
{
"changeVpcHaGroupMonitorIps": {
"monitorIps": [
"8.8.8.8"
]
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeVpcHaGroupMonitorIps":{"monitorIps":["8.8.8.8"]}}' http://localhost:8080/zstack/v1/vpc/hagroups/580eaca0eceb3da1bc03aa0b2dfaed64/monitorIps参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.5.1 | |
| monitorIps (可选) | List | body(包含在changeVpcHaGroupMonitorIps结构中) | 3.5.1 | ||
| systemTags (可选) | List | body | 3.5.1 | ||
| userTags (可选) | List | body | 3.5.1 |
API返回
返回示例
{
"inventory": {
"uuid": "85ba2342e37930f6a0cdd056565654cd",
"name": "test-vpcha",
"monitors": [
{
"id": 0.0,
"vpcHaRouterUuid": "85ba2342e37930f6a0cdd056565654cd",
"monitorIp": "1.1.1.1"
}
],
"vrRefs": [
{
"uuid": "c109f7860f2439ca86d1dbc51dbece39",
"vpcHaRouterUuid": "85ba2342e37930f6a0cdd056565654cd"
}
]
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.5 |
| inventory | VpcHaGroupInventory | 详情参考inventory | 3.5 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| 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 |
#inventory
#monitors
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5 | |
| vpcHaRouterUuid | String | 3.5 | |
| monitorIp | String | 3.5 | |
| createDate | Timestamp | 创建时间 | 3.5 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5 |
#vrRefs
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.5 |
| VpcHaRouterUuid | String | 3.5 |
#services
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5 | |
| vpcHaRouterUuid | String | 3.5 | |
| networkServiceName | String | 3.5 | |
| networkServiceUuid | String | 3.5 | |
| createDate | Timestamp | 创建时间 | 3.5 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5 | |
| vpcHaRouterUuid | String | 3.5 | |
| vipUuid | String | VIP UUID | 3.5 |
| l3NetworkUuid | String | 三层网络UUID | 3.5 |
| ip | String | 3.5 | |
| netmask | String | 3.5 | |
| createDate | Timestamp | 创建时间 | 3.5 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5 |
SDK示例
Java
SDK
ChangeVpcHaGroupMonitorIpsAction action = new ChangeVpcHaGroupMonitorIpsAction();
action.uuid = "580eaca0eceb3da1bc03aa0b2dfaed64";
action.monitorIps = asList("8.8.8.8");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeVpcHaGroupMonitorIpsAction.Result res = action.call();Python
SDK
ChangeVpcHaGroupMonitorIpsAction action = ChangeVpcHaGroupMonitorIpsAction()
action.uuid = "580eaca0eceb3da1bc03aa0b2dfaed64"
action.monitorIps = [8.8.8.8]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeVpcHaGroupMonitorIpsAction.Result res = action.call()创建高可用组(CreateVpcHaGroup)
API请求
URLs
POST zstack/v1/vpc/hagroupsHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "vpcha-router",
"description": "this is a vpc for test",
"monitorIps": [
"8.8.8.8"
]
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"vpcha-router","description":"this is a vpc for test","monitorIps":["8.8.8.8"]}}' http://localhost:8080/zstack/v1/vpc/hagroups参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| name | String | body(包含在params结构中) | 资源名称 | 3.5.1 | |
| description (可选) | String | body(包含在params结构中) | 资源的详细描述 | 3.5.1 | |
| monitorIps (可选) | List | body(包含在params结构中) | 3.5.1 | ||
| resourceUuid (可选) | String | body(包含在params结构中) | 3.5.1 | ||
| tagUuids (可选) | List | body(包含在params结构中) | 标签UUID列表 | 3.5.1 | |
| systemTags (可选) | List | body | 3.5.1 | ||
| userTags (可选) | List | body | 3.5.1 |
API返回
返回示例
{
"inventory": {
"uuid": "d32cd856d4603754aa30d8fe60ea07a4",
"name": "test-vpcha",
"monitors": [
{
"id": 0.0,
"vpcHaRouterUuid": "d32cd856d4603754aa30d8fe60ea07a4",
"monitorIp": "1.1.1.1"
}
],
"vrRefs": [
{
"uuid": "a26bee5e86153d2aa579c01756ca0944",
"vpcHaRouterUuid": "d32cd856d4603754aa30d8fe60ea07a4"
}
]
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.5.1 |
| inventory | VpcHaGroupInventory | 详情参考inventory | 3.5.1 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.5.1 |
| description | String | 错误的概要描述 | 3.5.1 |
| details | String | 错误的详细信息 | 3.5.1 |
| elaboration | String | 保留字段,默认为null | 3.5.1 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.5.1 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.5.1 |
#inventory
#monitors
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| monitorIp | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#vrRefs
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.5.1 |
| VpcHaRouterUuid | String | 3.5.1 |
#services
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| networkServiceName | String | 3.5.1 | |
| networkServiceUuid | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| vipUuid | String | VIP UUID | 3.5.1 |
| l3NetworkUuid | String | 三层网络UUID | 3.5.1 |
| ip | String | 3.5.1 | |
| netmask | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
SDK示例
Java
SDK
CreateVpcHaGroupAction action = new CreateVpcHaGroupAction();
action.name = "vpcha-router";
action.description = "this is a vpc for test";
action.monitorIps = asList("8.8.8.8");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVpcHaGroupAction.Result res = action.call();Python
SDK
CreateVpcHaGroupAction action = CreateVpcHaGroupAction()
action.name = "vpcha-router"
action.description = "this is a vpc for test"
action.monitorIps = [8.8.8.8]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVpcHaGroupAction.Result res = action.call()删除高可用组(DeleteVpcHaGroup)
API请求
URLs
DELETE zstack/v1/vpc/hagroups/{uuid}?deleteMode={deleteMode}Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vpc/hagroups/90376847491b3d9a85df382f65d60a16?deleteMode=Permissive参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.5.1 | |
| deleteMode (可选) | String | body | 3.5.1 | ||
| systemTags (可选) | List | body | 3.5.1 | ||
| userTags (可选) | List | body | 3.5.1 |
API返回
该API成功时返回一个空的JSON结构
{},出错时返回的JSON结构包含一个error字段,例如:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK示例
Java
SDK
DeleteVpcHaGroupAction action = new DeleteVpcHaGroupAction();
action.uuid = "90376847491b3d9a85df382f65d60a16";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVpcHaGroupAction.Result res = action.call();Python
SDK
DeleteVpcHaGroupAction action = DeleteVpcHaGroupAction()
action.uuid = "90376847491b3d9a85df382f65d60a16"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVpcHaGroupAction.Result res = action.call()更新高可用组(UpdateVpcHaGroup)
API请求
URLs
PUT zstack/v1/vpc/hagroups/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"updateVpcHaGroup": {
"name": "ha-1",
"description": "vpc ha test"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVpcHaGroup":{"name":"ha-1","description":"vpc ha test"}}' http://localhost:8080/zstack/v1/vpc/hagroups/0f3d8a0c297f3972b798d128070ca785/actions参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.5.1 | |
| name (可选) | String | body(包含在updateVpcHaGroup结构中) | 资源名称 | 3.5.1 | |
| description (可选) | String | body(包含在updateVpcHaGroup结构中) | 资源的详细描述 | 3.5.1 | |
| systemTags (可选) | List | body | 3.5.1 | ||
| userTags (可选) | List | body | 3.5.1 |
API返回
返回示例
{
"inventory": {
"uuid": "5ddaa8fa444c3b0a8e9187d87eb026f6",
"name": "test-vpcha",
"monitors": [
{
"id": 0.0,
"vpcHaRouterUuid": "5ddaa8fa444c3b0a8e9187d87eb026f6",
"monitorIp": "1.1.1.1"
}
],
"vrRefs": [
{
"uuid": "184c6cab367e3da0aaf7624aa40bb3d0",
"vpcHaRouterUuid": "5ddaa8fa444c3b0a8e9187d87eb026f6"
}
]
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.5.1 |
| inventory | VpcHaGroupInventory | 详情参考inventory | 3.5.1 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.5.1 |
| description | String | 错误的概要描述 | 3.5.1 |
| details | String | 错误的详细信息 | 3.5.1 |
| elaboration | String | 保留字段,默认为null | 3.5.1 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.5.1 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.5.1 |
#inventory
#monitors
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| monitorIp | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#vrRefs
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.5.1 |
| VpcHaRouterUuid | String | 3.5.1 |
#services
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| networkServiceName | String | 3.5.1 | |
| networkServiceUuid | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| vipUuid | String | VIP UUID | 3.5.1 |
| l3NetworkUuid | String | 三层网络UUID | 3.5.1 |
| ip | String | 3.5.1 | |
| netmask | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
SDK示例
Java
SDK
UpdateVpcHaGroupAction action = new UpdateVpcHaGroupAction();
action.uuid = "0f3d8a0c297f3972b798d128070ca785";
action.name = "ha-1";
action.description = "vpc ha test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVpcHaGroupAction.Result res = action.call();Python
SDK
UpdateVpcHaGroupAction action = UpdateVpcHaGroupAction()
action.uuid = "0f3d8a0c297f3972b798d128070ca785"
action.name = "ha-1"
action.description = "vpc ha test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVpcHaGroupAction.Result res = action.call()查询高可用(QueryVpcHaGroup)
API请求
URLs
GET zstack/v1/vpc/hagroups
GET zstack/v1/vpc/hagroups/{uuid}Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/hagroups?q=uuid=3c5648a2a8a931cb9396d07479e833f7curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/hagroups/2dc01a9b66a73a9399a7c1f29c91863a可查询字段
运行CLI命令行工具,输入QueryVpcHaGroup并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "843c2f1083d33689b1ecc19bd802158b",
"name": "test-vpcha",
"monitors": [
{
"id": 0.0,
"vpcHaRouterUuid": "843c2f1083d33689b1ecc19bd802158b",
"monitorIp": "1.1.1.1"
}
],
"vrRefs": [
{
"uuid": "87c3f098d2c7387b867ba0beb5d1a561",
"vpcHaRouterUuid": "843c2f1083d33689b1ecc19bd802158b"
}
]
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.5.1 |
| inventories | List | 详情参考inventories | 3.5.1 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.5.1 |
| description | String | 错误的概要描述 | 3.5.1 |
| details | String | 错误的详细信息 | 3.5.1 |
| elaboration | String | 保留字段,默认为null | 3.5.1 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.5.1 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.5.1 |
#inventories
#monitors
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| monitorIp | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#vrRefs
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.5.1 |
| VpcHaRouterUuid | String | 3.5.1 |
#services
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| networkServiceName | String | 3.5.1 | |
| networkServiceUuid | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.5.1 | |
| vpcHaRouterUuid | String | 3.5.1 | |
| vipUuid | String | VIP UUID | 3.5.1 |
| l3NetworkUuid | String | 三层网络UUID | 3.5.1 |
| ip | String | 3.5.1 | |
| netmask | String | 3.5.1 | |
| createDate | Timestamp | 创建时间 | 3.5.1 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.5.1 |
SDK示例
Java
SDK
QueryVpcHaGroupAction action = new QueryVpcHaGroupAction();
action.conditions = asList("uuid=26a2360f164c3a7fba94281b9e24046c");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVpcHaGroupAction.Result res = action.call();Python
SDK
QueryVpcHaGroupAction action = QueryVpcHaGroupAction()
action.conditions = ["uuid=ddbc6e5deaee3fdfad33738ea1daefca"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVpcHaGroupAction.Result res = action.call()更新虚拟路由器(UpdateVirtualRouter)
API请求
URLs
PUT zstack/v1/vm-instances/appliances/virtual-routers/{vmInstanceUuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"updateVirtualRouter": {
"defaultRouteL3NetworkUuid": "9889c6be639d3aefb72ae84f435c94c7"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVirtualRouter":{"defaultRouteL3NetworkUuid":"9889c6be639d3aefb72ae84f435c94c7"}}' http://localhost:8080/zstack/v1/vm-instances/appliances/virtual-routers/abd7e9700ed839a583c5af6f8b4dd417/actions参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| vmInstanceUuid | String | body(包含在updateVirtualRouter结构中) | 资源的UUID,唯一标示该资源 | 3.9.0 | |
| defaultRouteL3NetworkUuid (可选) | String | body(包含在updateVirtualRouter结构中) | 3.9.0 | ||
| systemTags (可选) | List | body | 3.9.0 | ||
| userTags (可选) | List | body | 3.9.0 |
API返回
返回示例
{
"inventory": {
"publicNetworkUuid": "142981c8c8243113b52db453575fb03f",
"managementNetworkUuid": "1d182cdfa0a93daa9e4eb275b86645ff",
"name": "Test-Router",
"description": "this is a virtual router vm",
"clusterUuid": "ea4cb55d692a3c45a154892539117472",
"imageUuid": "3764ffab842333c895a9e1746315fab3",
"instanceOfferingUuid": "ba4019cd841430258d8943f281b36c19"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.9.0 |
| inventory | VirtualRouterVmInventory | 详情参考inventory | 3.9.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.9.0 |
| description | String | 错误的概要描述 | 3.9.0 |
| details | String | 错误的详细信息 | 3.9.0 |
| elaboration | String | 保留字段,默认为null | 3.9.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.9.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.9.0 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| publicNetworkUuid | String | 3.9.0 | |
| virtualRouterVips | List | 3.9.0 | |
| applianceVmType | String | 3.9.0 | |
| managementNetworkUuid | String | 3.9.0 | |
| defaultRouteL3NetworkUuid | String | 3.9.0 | |
| status | String | 3.9.0 | |
| agentPort | Integer | 3.9.0 | |
| haStatus | String | 3.9.0 | |
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| name | String | 资源名称 | 3.9.0 |
| description | String | 资源的详细描述 | 3.9.0 |
| zoneUuid | String | 区域UUID | 3.9.0 |
| clusterUuid | String | 集群UUID | 3.9.0 |
| imageUuid | String | 镜像UUID | 3.9.0 |
| hostUuid | String | 物理机UUID | 3.9.0 |
| lastHostUuid | String | 3.9.0 | |
| instanceOfferingUuid | String | 计算规格UUID | 3.9.0 |
| rootVolumeUuid | String | 根云盘UUID | 3.9.0 |
| platform | String | 3.9.0 | |
| defaultL3NetworkUuid | String | 3.9.0 | |
| type | String | 3.9.0 | |
| hypervisorType | String | 3.9.0 | |
| memorySize | Long | 3.9.0 | |
| cpuNum | Integer | 3.9.0 | |
| cpuSpeed | Long | 3.9.0 | |
| allocatorStrategy | String | 3.9.0 | |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
| state | String | 3.9.0 | |
| vmNics | List | 详情参考vmNics | 3.9.0 |
| allVolumes | List | 详情参考allVolumes | 3.9.0 |
| vmCdRoms | List | 详情参考vmCdRoms | 3.9.0 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| vmInstanceUuid | String | 云主机UUID | 3.9.0 |
| l3NetworkUuid | String | 三层网络UUID | 3.9.0 |
| ip | String | 3.9.0 | |
| mac | String | 3.9.0 | |
| hypervisorType | String | 3.9.0 | |
| netmask | String | 3.9.0 | |
| gateway | String | 3.9.0 | |
| metaData | String | 3.9.0 | |
| ipVersion | Integer | 3.9.0 | |
| driverType | String | 3.9.0 | |
| deviceId | Integer | 3.9.0 | |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
| usedIps | List | 详情参考usedIps | 3.9.0 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| ipRangeUuid | String | IP段UUID | 3.9.0 |
| l3NetworkUuid | String | 三层网络UUID | 3.9.0 |
| ipVersion | Integer | 3.9.0 | |
| ip | String | 3.9.0 | |
| netmask | String | 3.9.0 | |
| gateway | String | 3.9.0 | |
| usedFor | String | 3.9.0 | |
| ipInLong | long | 3.9.0 | |
| vmNicUuid | String | 云主机网卡UUID | 3.9.0 |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| name | String | 资源名称 | 3.9.0 |
| description | String | 资源的详细描述 | 3.9.0 |
| primaryStorageUuid | String | 主存储UUID | 3.9.0 |
| vmInstanceUuid | String | 云主机UUID | 3.9.0 |
| diskOfferingUuid | String | 云盘规格UUID | 3.9.0 |
| rootImageUuid | String | 3.9.0 | |
| installPath | String | 3.9.0 | |
| type | String | 3.9.0 | |
| format | String | 3.9.0 | |
| size | Long | 3.9.0 | |
| actualSize | Long | 3.9.0 | |
| deviceId | Integer | 3.9.0 | |
| state | String | 3.9.0 | |
| status | String | 3.9.0 | |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
| isShareable | Boolean | 3.9.0 | |
| volumeQos | String | 3.9.0 |
#vmCdRoms
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| vmInstanceUuid | String | 云主机UUID | 3.9.0 |
| deviceId | Integer | 3.9.0 | |
| isoUuid | String | 3.9.0 | |
| isoInstallPath | String | 3.9.0 | |
| name | String | 资源名称 | 3.9.0 |
| description | String | 资源的详细描述 | 3.9.0 |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
SDK示例
Java
SDK
UpdateVirtualRouterAction action = new UpdateVirtualRouterAction();
action.vmInstanceUuid = "abd7e9700ed839a583c5af6f8b4dd417";
action.defaultRouteL3NetworkUuid = "9889c6be639d3aefb72ae84f435c94c7";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVirtualRouterAction.Result res = action.call();Python
SDK
UpdateVirtualRouterAction action = UpdateVirtualRouterAction()
action.vmInstanceUuid = "abd7e9700ed839a583c5af6f8b4dd417"
action.defaultRouteL3NetworkUuid = "9889c6be639d3aefb72ae84f435c94c7"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVirtualRouterAction.Result res = action.call()VPC路由器软件版本升级(UpdateVirtualRouterSoftwareVersion)
API请求
URLs
POST zstack/v1/vpc/virtual-routers/{uuid}/softwareversionHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"softwareName": "IPsec",
"targetVersion": "5.9.4"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"softwareName":"IPsec","targetVersion":"5.9.4"}}' \
http://localhost:8080/zstackv1/vpc/virtual-routers/8971d40547ca3641ac809bb967426e17/softwareversion参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 4.5.0 | |
| softwareName | String | body(包含在params结构中) | VPC路由器软件名称 |
|
4.5.0 |
| targetVersion | String | body(包含在params结构中) | 目标版本 |
|
4.5.0 |
| systemTags (可选) | List | body | 系统标签 | 4.5.0 | |
| userTags (可选) | List | body | 用户标签 | 4.5.0 |
API返回
该API成功时返回一个空的JSON结构{},出错时返回的JSON结构包含一个error字段,例如:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK示例
Java
SDK
UpdateVirtualRouterSoftwareVersionAction action = new UpdateVirtualRouterSoftwareVersionAction();
action.uuid = "8971d40547ca3641ac809bb967426e17";
action.softwareName = "IPsec";
action.targetVersion = "5.9.4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVirtualRouterSoftwareVersionAction.Result res = action.call();Python
SDK
UpdateVirtualRouterSoftwareVersionAction action = UpdateVirtualRouterSoftwareVersionAction()
action.uuid = "8971d40547ca3641ac809bb967426e17"
action.softwareName = "IPsec"
action.targetVersion = "5.9.4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVirtualRouterSoftwareVersionAction.Result res = action.call()获取VPC路由器软件版本(GetVirtualRouterSoftwareVersion)
API请求
URLs
GET zstack/v1/vpc/virtual-routers/{uuid}/softwareversionHeaders
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vpc/virtual-routers/softwareversion \
uuid=c25bedf80bde367a86344add1264ed06&softwareName=IPsec&needUpdate=false参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid (可选) | String | query | 资源的UUID,唯一标示该资源 | 4.5.0 | |
| softwareName | String | query | VPC路由器软件名称 | IPsec | 4.5.0 |
| needUpdate (可选) | Boolean | query | 是否需要升级 | 4.5.0 | |
| systemTags (可选) | List | query | 系统标签 | 4.5.0 | |
| userTags (可选) | List | query | 用户标签 | 4.5.0 |
API返回
返回示例
{
"inventories": [
{
"uuid": "4eb255bf21ff3b3384768b06aa612818",
"softwareName": "IPsec",
"currentVersion": "4.5.2",
"latestVersion": "5.9.4"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 4.5.0 | |
| inventories | List | 详情参考inventories | 4.5.0 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.5.0 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.0 |
| softwareName | String | VPC软件名称 | 4.5.0 |
| currentVersion | String | 当前版本 | 4.5.0 |
| latestVersion | String | 最新版本 | 4.5.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 4.5.0 |
| description | String | 错误的概要描述 | 4.5.0 |
| details | String | 错误的详细信息 | 4.5.0 |
| elaboration | String | 保留字段,默认为null | 4.5.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 4.5.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 4.5.0 |
SDK示例
Java
SDK
GetVirtualRouterSoftwareVersionAction action = new GetVirtualRouterSoftwareVersionAction();
action.uuid = "c25bedf80bde367a86344add1264ed06";
action.softwareName = "IPsec";
action.needUpdate = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVirtualRouterSoftwareVersionAction.Result res = action.call();Python
SDK
GetVirtualRouterSoftwareVersionAction action = GetVirtualRouterSoftwareVersionAction()
action.uuid = "c25bedf80bde367a86344add1264ed06"
action.softwareName = "IPsec"
action.needUpdate = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVirtualRouterSoftwareVersionAction.Result res = action.call()