OSPF相关接口
创建路由区域资源(CreateVRouterOspfArea)
API请求
URLs
POST zstack/v1/routerAreaHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"areaId": "1.1.1.1"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"areaId":"1.1.1.1"}}' http://localhost:8080/zstack/v1/routerArea参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| areaId | String | body(包含在params结构中) | 区域Id,区域标识 | 3.4.0 | |
| areaAuth (可选) | String | body(包含在params结构中) | OSPF区域的认证方式 | 3.4.0 | |
| areaType (可选) | String | body(包含在params结构中) | 区域类型 | 3.4.0 | |
| password (可选) | String | body(包含在params结构中) | 认证方式为plaintext时的密码 | 3.4.0 | |
| keyId (可选) | Integer | body(包含在params结构中) | 认证方式为MD5时用到的keyid | 3.4.0 | |
| resourceUuid (可选) | String | body(包含在params结构中) | 区域资源的唯一标识 | 3.4.0 | |
| tagUuids (可选) | List | body(包含在params结构中) | 标签UUID列表 | 3.4.0 | |
| systemTags (可选) | List | body | 系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 用户标签 | 3.4.0 |
API返回
返回示例
{
"inventory": {
"uuid": "d82d2b6108b0331b90161b939987e5ae",
"areaId": "1",
"type": "Stub",
"authentication": "Plaintext",
"password": "password",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| inventory | RouterAreaInventory | 详情参考inventory | 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| areaId | String | 3.4.0 | |
| type | String | 3.4.0 | |
| authentication | String | 3.4.0 | |
| password | String | 3.4.0 | |
| keyId | Integer | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java
SDK
CreateVRouterOspfAreaAction action = new CreateVRouterOspfAreaAction();
action.areaId = "1.1.1.1";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVRouterOspfAreaAction.Result res = action.call();Python
SDK
CreateVRouterOspfAreaAction action = CreateVRouterOspfAreaAction()
action.areaId = "1.1.1.1"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVRouterOspfAreaAction.Result res = action.call()删除OSPF路由区域(DeleteVRouterOspfArea)
API请求
URLs
DELETE zstack/v1/routerArea/{uuid}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/routerArea/8c7d2c714e1231549dd2a66a3f140ae5参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.4.0 | |
| deleteMode (可选) | String | body | 3.4.0 | ||
| systemTags (可选) | List | body | 系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 用户标签 | 3.4.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
DeleteVRouterOspfAreaAction action = new DeleteVRouterOspfAreaAction();
action.uuid = "8c7d2c714e1231549dd2a66a3f140ae5";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVRouterOspfAreaAction.Result res = action.call();Python
SDK
DeleteVRouterOspfAreaAction action = DeleteVRouterOspfAreaAction()
action.uuid = "8c7d2c714e1231549dd2a66a3f140ae5"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVRouterOspfAreaAction.Result res = action.call()获取OSPF的邻居信息(GetVRouterOspfNeighbor)
API请求
URLs
GET zstack/v1/routerArea/{vRouterUuid}/neighborHeaders
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/routerArea/dfb6151287b632599becfc5716b8c374/neighbor参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| vRouterUuid | String | url | 路由器的uuid,唯一标识 | 3.4.0 | |
| systemTags (可选) | List | query | 系统标签 | 3.4.0 | |
| userTags (可选) | List | query | 用户标签 | 3.4.0 |
API返回
返回示例
{
"neighbors": [
null,
null
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| neighbors | List | 详情参考neighbors | 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 |
#neighbors
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | String | 3.4.0 | |
| priority | String | 3.4.0 | |
| state | String | 3.4.0 | |
| deadTime | String | 3.4.0 | |
| neighborAddress | String | 3.4.0 | |
| device | String | 3.4.0 |
SDK示例
Java
SDK
GetVRouterOspfNeighborAction action = new GetVRouterOspfNeighborAction();
action.vRouterUuid = "dfb6151287b632599becfc5716b8c374";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVRouterOspfNeighborAction.Result res = action.call();Python
SDK
GetVRouterOspfNeighborAction action = GetVRouterOspfNeighborAction()
action.vRouterUuid = "dfb6151287b632599becfc5716b8c374"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVRouterOspfNeighborAction.Result res = action.call()查询OSPF路由区域信息(QueryVRouterOspfArea)
API请求
URLs
GET zstack/v1/routerArea
GET zstack/v1/routerArea/{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/routerArea?q=areaId=1.1.1.1curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/routerArea/aba25a3e8e0e3b46bcb48042812eb38d可查询字段
运行CLI命令行工具,输入QueryVRouterOspfArea并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "24b7fb05b43538238f2071c81255fb35",
"areaId": "1",
"type": "Standard",
"authentication": "None",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| inventories | List | 详情参考inventories | 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 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| areaId | String | 3.4.0 | |
| type | String | 3.4.0 | |
| authentication | String | 3.4.0 | |
| password | String | 3.4.0 | |
| keyId | Integer | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java
SDK
QueryVRouterOspfAreaAction action = new QueryVRouterOspfAreaAction();
action.conditions = asList("areaId=1.1.1.1");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVRouterOspfAreaAction.Result res = action.call();Python
SDK
QueryVRouterOspfAreaAction action = QueryVRouterOspfAreaAction()
action.conditions = ["areaId=1.1.1.1"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVRouterOspfAreaAction.Result res = action.call()获取路由器的ID(GetVRouterRouterId)
API请求
URLs
GET zstack/v1/routerArea/{vRouterUuid}/routeridHeaders
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/routerArea/9b8b08cd553c3fd1ba4efc3e6c98512d/routerid?参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| vRouterUuid | String | url | 路由器的UUID,唯一标识 | 3.4.0 | |
| systemTags (可选) | List | query | 系统标签 | 3.4.0 | |
| userTags (可选) | List | query | 用户标签 | 3.4.0 |
Note:
- ZStack Cloud获取路由器的ID时支持表示OSPF协议中路由器的routerID,SystemTags增加routeProtocolRouterId选项。
- 选项格式为:
routeProtocolRouterId::xxxx - 例如:
routeProtocolRouterId::1.1.1.1
- 选项格式为:
API返回
返回示例
{
"routerId": "10.10.10.1"
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| routerId | 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
GetVRouterRouterIdAction action = new GetVRouterRouterIdAction();
action.vRouterUuid = "9b8b08cd553c3fd1ba4efc3e6c98512d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVRouterRouterIdAction.Result res = action.call();Python
SDK
GetVRouterRouterIdAction action = GetVRouterRouterIdAction()
action.vRouterUuid = "9b8b08cd553c3fd1ba4efc3e6c98512d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVRouterRouterIdAction.Result res = action.call()设置路由器的ID(SetVRouterRouterId)
API请求
URLs
POST zstack/v1/routerArea/{vRouterUuid}/routeridHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"routerId": "10.10.10.1"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"routerId":"10.10.10.1"}}' http://localhost:8080/zstack/v1/routerArea/7b579cbb55f73f62a5afcfe83c823b7b/routerid参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| vRouterUuid | String | url | 路由器的UUID,唯一标识 | 3.4.0 | |
| routerId | String | body(包含在params结构中) | IP地址形式的ID | 3.4.0 | |
| systemTags (可选) | List | body | 系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 用户标签 | 3.4.0 |
Note:
- ZStack Cloud设置路由器的ID时支持表示OSPF协议中路由器的routerID,SystemTags增加routeProtocolRouterId选项。
- 选项格式为:
routeProtocolRouterId::xxxx - 例如:
routeProtocolRouterId::1.1.1.1
- 选项格式为:
API返回
返回示例
{
"routerId": "10.10.10.1"
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| routerId | 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
SetVRouterRouterIdAction action = new SetVRouterRouterIdAction();
action.vRouterUuid = "7b579cbb55f73f62a5afcfe83c823b7b";
action.routerId = "10.10.10.1";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVRouterRouterIdAction.Result res = action.call();Python
SDK
SetVRouterRouterIdAction action = SetVRouterRouterIdAction()
action.vRouterUuid = "7b579cbb55f73f62a5afcfe83c823b7b"
action.routerId = "10.10.10.1"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVRouterRouterIdAction.Result res = action.call()添加网络到OSPF的区域(AddVRouterNetworksToOspfArea)
API请求
URLs
POST zstack/v1/routerArea/{routerAreaUuid}/router/{vRouterUuid}/addnetworksHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"l3NetworkUuids": [
"080a5356667a34e3bda18a157e3743ec"
]
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"l3NetworkUuids":["080a5356667a34e3bda18a157e3743ec"]}}' http://localhost:8080/zstack/v1/routerArea/2785aa6a32603b7a8a24b5a143975123/router/beaad9552cd531b7b59c631d0b0f7eb9/addnetworks参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| routerAreaUuid | String | url | 路由区域的id,唯一标识 | 3.4.0 | |
| vRouterUuid | String | url | vpc路由器的唯一标识id | 3.4.0 | |
| l3NetworkUuids | List | body(包含在params结构中) | 3层网络的唯一标识id | 3.4.0 | |
| resourceUuid (可选) | String | body(包含在params结构中) | 资源的标识id | 3.4.0 | |
| tagUuids (可选) | List | body(包含在params结构中) | 标签UUID列表 | 3.4.0 | |
| systemTags (可选) | List | body | 路由器系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 路由器用户标签 | 3.4.0 |
API返回
返回示例
{
"inventory": {
"dns": [
{
"vpcRouterUuid": "acc537da2e003f349ed4cd9cf53eaab4",
"dns": "8.8.8.8"
}
],
"routerAreaRef": [
{
"uuid": "b3a4930e15fa358b9a2943b320ecf886",
"vRouterUuid": "b02959e102353bfd9fd14a149fa20565",
"routerAreaUuid": "d397110ba793345797e33bc6ed3db65f",
"l3NetworkUuid": "202258e4c4893f85a6b5baa7b8b55bb0",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"applianceVmType": "vpcvrouter",
"managementNetworkUuid": "b877c7f5faca31c2a31575a70352ebc8",
"status": "Connected",
"agentPort": 7272.0,
"uuid": "acc537da2e003f349ed4cd9cf53eaab4",
"name": "TestVPC",
"description": "this is a vpc for test",
"zoneUuid": "6ccc1079e90737768bf679ce611f9fe7",
"clusterUuid": "b15eecfa47083749811d79e2780f6f91",
"imageUuid": "15790865172133e1b8a2d7a1374d5732",
"hostUuid": "d332dc4237c332adbc2079bdb904ca36",
"lastHostUuid": "8d79aaec39033ed89facfb3089715d31",
"instanceOfferingUuid": "274cf5e3e2123fb1a7309ca9273d1436",
"rootVolumeUuid": "7dc7594d739c39a5ab89806e96b722f6",
"platform": "Linux",
"defaultL3NetworkUuid": "5c8c85ba45c83490b2cf8db490f483c0",
"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": "72cc686cd7b83b53aad2036b99a84c07",
"vmInstanceUuid": "acc537da2e003f349ed4cd9cf53eaab4",
"usedIpUuid": "92683b734202356d8fa8e6cb7447b4e1",
"l3NetworkUuid": "69c3dba93a423bf4a1cecbd86da9261b",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"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": "7dc7594d739c39a5ab89806e96b722f6",
"name": "Root-Volume-For-VM-acc537da2e003f349ed4cd9cf53eaab4",
"primaryStorageUuid": "5d93dbda7e4e386891657de613d9a28d",
"vmInstanceUuid": "acc537da2e003f349ed4cd9cf53eaab4",
"diskOfferingUuid": "52bc981286ea3087b9969e47aa520fac",
"rootImageUuid": "15790865172133e1b8a2d7a1374d5732",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-7dc7594d739c39a5ab89806e96b722f6/7dc7594d739c39a5ab89806e96b722f6.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 | 3.4.0 |
| inventory | VpcRouterVmInventory | 详情参考inventory | 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| publicNetworkUuid | String | 3.4.0 | |
| virtualRouterVips | List | 3.4.0 | |
| applianceVmType | String | 3.4.0 | |
| managementNetworkUuid | String | 3.4.0 | |
| defaultRouteL3NetworkUuid | String | 3.4.0 | |
| status | String | 3.4.0 | |
| agentPort | Integer | 3.4.0 | |
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| name | String | 资源名称 | 3.4.0 |
| description | String | 资源的详细描述 | 3.4.0 |
| zoneUuid | String | 区域UUID | 3.4.0 |
| clusterUuid | String | 集群UUID | 3.4.0 |
| imageUuid | String | 镜像UUID | 3.4.0 |
| hostUuid | String | 物理机UUID | 3.4.0 |
| lastHostUuid | String | 3.4.0 | |
| instanceOfferingUuid | String | 计算规格UUID | 3.4.0 |
| rootVolumeUuid | String | 根云盘UUID | 3.4.0 |
| platform | String | 3.4.0 | |
| defaultL3NetworkUuid | String | 3.4.0 | |
| type | String | 3.4.0 | |
| hypervisorType | String | 3.4.0 | |
| memorySize | Long | 3.4.0 | |
| cpuNum | Integer | 3.4.0 | |
| cpuSpeed | Long | 3.4.0 | |
| allocatorStrategy | String | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
| state | String | 3.4.0 | |
| dns | List | 详情参考dns | 3.4.0 |
| routerAreaRef | List | 详情参考routerAreaRef | 3.4.0 |
| vmNics | List | 详情参考vmNics | 3.4.0 |
| allVolumes | List | 详情参考allVolumes | 3.4.0 |
| vmCdRoms | List | 详情参考vmCdRoms | 3.4.0 |
#dns
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| id | Long | 3.4.0 | |
| vpcRouterUuid | String | 3.4.0 | |
| dns | String | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
#routerAreaRef
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| vRouterUuid | String | 3.4.0 | |
| routerAreaUuid | String | 3.4.0 | |
| l3NetworkUuid | String | 三层网络UUID | 3.4.0 |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
#vmNics
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| vmInstanceUuid | String | 云主机UUID | 3.4.0 |
| l3NetworkUuid | String | 三层网络UUID | 3.4.0 |
| ip | String | 3.4.0 | |
| mac | String | 3.4.0 | |
| hypervisorType | String | 3.4.0 | |
| netmask | String | 3.4.0 | |
| gateway | String | 3.4.0 | |
| metaData | String | 3.4.0 | |
| ipVersion | Integer | 3.4.0 | |
| deviceId | Integer | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
| usedIps | List | 详情参考usedIps | 3.4.0 |
#usedIps
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| ipRangeUuid | String | IP段UUID | 3.4.0 |
| l3NetworkUuid | String | 三层网络UUID | 3.4.0 |
| ipVersion | Integer | 3.4.0 | |
| ip | String | 3.4.0 | |
| netmask | String | 3.4.0 | |
| gateway | String | 3.4.0 | |
| usedFor | String | 3.4.0 | |
| ipInLong | long | 3.4.0 | |
| vmNicUuid | String | 云主机网卡UUID | 3.4.0 |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
#allVolumes
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| name | String | 资源名称 | 3.4.0 |
| description | String | 资源的详细描述 | 3.4.0 |
| primaryStorageUuid | String | 主存储UUID | 3.4.0 |
| vmInstanceUuid | String | 云主机UUID | 3.4.0 |
| diskOfferingUuid | String | 云盘规格UUID | 3.4.0 |
| rootImageUuid | String | 3.4.0 | |
| installPath | String | 3.4.0 | |
| type | String | 3.4.0 | |
| format | String | 3.4.0 | |
| size | Long | 3.4.0 | |
| actualSize | Long | 3.4.0 | |
| deviceId | Integer | 3.4.0 | |
| state | String | 3.4.0 | |
| status | String | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
| isShareable | Boolean | 3.4.0 | |
| volumeQos | String | 3.4.0 |
#vmCdRoms
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| vmInstanceUuid | String | 云主机UUID | 3.4.0 |
| deviceId | Integer | 3.4.0 | |
| isoUuid | String | 3.4.0 | |
| isoInstallPath | String | 3.4.0 | |
| name | String | 资源名称 | 3.4.0 |
| description | String | 资源的详细描述 | 3.4.0 |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java
SDK
AddVRouterNetworksToOspfAreaAction action = new AddVRouterNetworksToOspfAreaAction();
action.routerAreaUuid = "2785aa6a32603b7a8a24b5a143975123";
action.vRouterUuid = "beaad9552cd531b7b59c631d0b0f7eb9";
action.l3NetworkUuids = asList("080a5356667a34e3bda18a157e3743ec");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddVRouterNetworksToOspfAreaAction.Result res = action.call();Python
SDK
AddVRouterNetworksToOspfAreaAction action = AddVRouterNetworksToOspfAreaAction()
action.routerAreaUuid = "2785aa6a32603b7a8a24b5a143975123"
action.vRouterUuid = "beaad9552cd531b7b59c631d0b0f7eb9"
action.l3NetworkUuids = [080a5356667a34e3bda18a157e3743ec]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddVRouterNetworksToOspfAreaAction.Result res = action.call()从路由区域中移除网络(RemoveVRouterNetworksFromOspfArea)
API请求
URLs
DELETE zstack/v1/routerArea/networksHeaders
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/routerArea/networks?参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuids | List | body | 网络区域表中的uuid,全局唯一标识 | 3.4.0 | |
| deleteMode (可选) | String | body | 3.4.0 | ||
| systemTags (可选) | List | body | 3.4.0 | ||
| userTags (可选) | List | body | 3.4.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
RemoveVRouterNetworksFromOspfAreaAction action = new RemoveVRouterNetworksFromOspfAreaAction();
action.uuids = asList("ad747eefbaf534d4a46822cc02fd329a");
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveVRouterNetworksFromOspfAreaAction.Result res = action.call();Python
SDK
RemoveVRouterNetworksFromOspfAreaAction action = RemoveVRouterNetworksFromOspfAreaAction()
action.uuids = [ad747eefbaf534d4a46822cc02fd329a]
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveVRouterNetworksFromOspfAreaAction.Result res = action.call()更改OSPF的路由区域属性(UpdateVRouterOspfArea)
API请求
URLs
PUT zstack/v1/routerArea/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"updateVRouterOspfArea": {
"areaType": "Standard"
},
"systemTags": [],
"userTags": []
}Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVRouterOspfArea":{"areaType":"Standard"}}' http://localhost:8080/zstack/v1/routerArea/35bc0bb59575326c822b07a945b48a51/actions参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.4.0 | |
| areaAuth (可选) | String | body(包含在updateVRouterOspfArea结构中) | 区域认证方式 | 3.4.0 | |
| areaType (可选) | String | body(包含在updateVRouterOspfArea结构中) | 区域类型 | 3.4.0 | |
| password (可选) | String | body(包含在updateVRouterOspfArea结构中) | 认证需要的password | 3.4.0 | |
| keyId (可选) | Integer | body(包含在updateVRouterOspfArea结构中) | 认证需要的KeyID | 3.4.0 | |
| systemTags (可选) | List | body | 系统标签 | 3.4.0 | |
| userTags (可选) | List | body | 用户标签 | 3.4.0 |
API返回
返回示例
{
"inventory": {
"uuid": "b90552421b6a390fa55da5b489a53e32",
"areaId": "1",
"type": "Stub",
"authentication": "MD5",
"keyId": 128.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| inventory | RouterAreaInventory | 详情参考inventory | 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 |
#inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| areaId | String | 3.4.0 | |
| type | String | 3.4.0 | |
| authentication | String | 3.4.0 | |
| password | String | 3.4.0 | |
| keyId | Integer | 3.4.0 | |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java
SDK
UpdateVRouterOspfAreaAction action = new UpdateVRouterOspfAreaAction();
action.uuid = "35bc0bb59575326c822b07a945b48a51";
action.areaType = "Standard";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVRouterOspfAreaAction.Result res = action.call();Python
SDK
UpdateVRouterOspfAreaAction action = UpdateVRouterOspfAreaAction()
action.uuid = "35bc0bb59575326c822b07a945b48a51"
action.areaType = "Standard"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVRouterOspfAreaAction.Result res = action.call()查询路由加入到区域的网络信息(QueryVRouterOspfNetwork)
API请求
URLs
GET zstack/v1/routerArea/network
GET zstack/v1/routerArea/networkR/{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/routerArea/network?curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/routerArea/networkR/cbdc3b6f584539508a95f2fe8fc0d6bb可查询字段
运行CLI命令行工具,输入QueryVRouterOspfNetwork并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "fb2a103989cd3ad581c3ad6931765a2e",
"vRouterUuid": "2449c7b9976c301bb5917cf25e021e65",
"routerAreaUuid": "e53cb89baf223faf9b2683752c80a3a5",
"l3NetworkUuid": "937b798289cf30bf884600143b5dfc0d",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| inventories | List | 详情参考inventories | 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 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.4.0 |
| vRouterUuid | String | 3.4.0 | |
| routerAreaUuid | String | 3.4.0 | |
| l3NetworkUuid | String | 三层网络UUID | 3.4.0 |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java
SDK
QueryVRouterOspfNetworkAction action = new QueryVRouterOspfNetworkAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVRouterOspfNetworkAction.Result res = action.call();Python
SDK
QueryVRouterOspfNetworkAction action = QueryVRouterOspfNetworkAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVRouterOspfNetworkAction.Result res = action.call()