文档目录

SDN设备相关接口

添加SDN控制器(AddSdnController)

API请求

URLs
POST zstack/v1/sdn-controllers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vendorType": "vendor",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "userName": "admin",
    "password": "password"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vendorType":"vendor","name":"sdn-1","description":"sdn controller from vendor","ip":"192.168.1.1","userName":"admin","password":"password"}}' http://localhost:8080/zstack/v1/sdn-controllers
参数列表
名字 类型 位置 描述 可选值 起始版本
vendorType String body(包含在params结构中) 3.7
name String body(包含在params结构中) 资源名称 3.7
description (可选) String body(包含在params结构中) 资源的详细描述 3.7
ip String body(包含在params结构中) 3.7
userName (可选) String body(包含在params结构中) 3.7
password (可选) String body(包含在params结构中) 3.7
resourceUuid (可选) String body(包含在params结构中) 3.7
tagUuids (可选) List body(包含在params结构中) 标签UUID列表 3.7
systemTags (可选) List body 3.7
userTags (可选) List body 3.7
zoneUuid (可选) String body(包含在params结构中) 区域UUID 5.3.0
Note:
  • ZStack Cloud添加SDN控制器时支持创建H3C SDN控制,SystemTags增加H3C_VDS_UUID选项,使用 vdsUuid参数来传递 SystemTag。
    • 选项格式为:vdsUuid::{%s}
    • 例如:vdsUuid::1234-5678
    • 关联资源:SdnControllerVO.class
  • ZStack Cloud添加华为SDN控制器时支持记录SDN控制使用VLAN范围,SystemTags增加startVlan::endVlan::选项。
    • 选项格式为:startVlan::{%s}::endVlan::{%s}
    • 例如:startVlan::110::endVlan::120
    • 关联资源:SdnControllerVO.class
    • ZStack Cloud添加H3C v1 SDN控制器时支持记录SDN控制使用vni 范围,SystemTags增加startVni::endVni::选项。
      • 选项格式为:startVni::{%s}::endVni::{%s}
      • 例如: startVni::100::endVni::200
      • 关联资源:SdnControllerVO.class

API返回

返回示例
{
  "inventory": {
    "uuid": "2f7e443a152833efb0f4b7d196a35ce0",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 0.6
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 3.7.0
inventory SdnControllerInventory 详情参考inventory 3.7.0
#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
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器Uuid 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0

SDK示例

Java SDK
AddSdnControllerAction action = new AddSdnControllerAction();
action.vendorType = "vendor";
action.name = "sdn-1";
action.description = "sdn controller from vendor";
action.ip = "192.168.1.1";
action.userName = "admin";
action.password = "password";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSdnControllerAction.Result res = action.call();
Python SDK
AddSdnControllerAction action = AddSdnControllerAction()
action.vendorType = "vendor"
action.name = "sdn-1"
action.description = "sdn controller from vendor"
action.ip = "192.168.1.1"
action.userName = "admin"
action.password = "password"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSdnControllerAction.Result res = action.call()

删除SDN控制器(RemoveSdnController)

API请求

URLs
DELETE zstack/v1/sdn-controllers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controllers/237901c5097b38c480315569a1ac7567?deleteMode=Permissive
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 3.7.0
deleteMode (可选) String body 3.7.0
systemTags (可选) List body 3.7.0
userTags (可选) List body 3.7.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
RemoveSdnControllerAction action = new RemoveSdnControllerAction();
action.uuid = "237901c5097b38c480315569a1ac7567";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveSdnControllerAction.Result res = action.call();
Python SDK
RemoveSdnControllerAction action = RemoveSdnControllerAction()
action.uuid = "237901c5097b38c480315569a1ac7567"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveSdnControllerAction.Result res = action.call()

查询SDN控制器(QuerySdnController)

API请求

URLs
GET zstack/v1/sdn-controllers
GET zstack/v1/sdn-controllers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controllers?q=uuid=5e897e7e3a663786b873a3e020dbfc0a
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controllers/37c3e4f7602930c5888107528521ac90

可查询字段

运行CLI命令行工具,输入QuerySdnController并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "b4134eb269a632eda5df826686733c5e",
      "name": "test-sdn",
      "description": "sdn for test",
      "ip": "192.168.1.1",
      "username": "admin",
      "password": "password"
    }
  ]
}
名字 类型 描述 起始版本
success boolean 0.6
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 3.7.0
inventories List 详情参考inventories 3.7.0
#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
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器Uuid 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0

SDK示例

Java SDK
QuerySdnControllerAction action = new QuerySdnControllerAction();
action.conditions = asList("uuid=e9f330402ed03b32a865ac4f19890589");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySdnControllerAction.Result res = action.call();
Python SDK
QuerySdnControllerAction action = QuerySdnControllerAction()
action.conditions = ["uuid=d6a1f2d694273d31bfd23736ab530e44"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySdnControllerAction.Result res = action.call()

修改SDN控制器(ChangeSdnController)

API请求

URLs
PUT zstack/v1/sdn-controllers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeSdnController": {
    "userName": "sdnuser",
    "password": "newpassword"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeSdnController":{"userName":"sdnuser","password":"newpassword"}}' http://localhost:8080/zstack/v1/sdn-controllers/fde0b2acbe6c3c7192e32d113f4e00b8/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url SDN控制器资源UUID 5.4.0
userName (可选) String body(包含在changeSdnController结构中) SDN控制器新用户名 5.4.0
password (可选) String body(包含在changeSdnController结构中) SDN控制器新密码 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.4.0
vlanRanges (可选) List body(包含在changeSdnController结构中) 5.4.0
Note:
  • ZStack Cloud创建三层网络时支持指定端口镜像网络,SystemTags增加mirrorNetwork选项。
    • 选项格式为:mirrorNetwork::{L3NetworkVOUuid}
    • 例如:mirrorNetwork::1c707a63817b4f29b1235fa1f76c0ccc
  • ZStack Cloud创建三层网络时支持记录vpc网关关联的华为sdn虚拟路由uuid,SystemTags增加logicalRouterUuid选项。
    • 选项格式为:logicalRouterUuid::{%s}
    • 例如:logicalRouterUuid::ecb4a71e0e32476da948a583ea0a220d
  • ZStack Cloud添加华为SDN控制器时支持记录sdn控制使用vlan 范围,SystemTags增加startVlan::endVlan::选项。
    • 选项格式为:startVlan::{%s}::endVlan::{%s}
    • 例如:startVlan::100::endVlan::1000

API返回

返回示例
{
  "inventory": {
    "uuid": "cd65a5af636038bf91f4e404ef9594b1",
    "vendorType": "H3C-VCFC",
    "name": "updated-sdn-controller",
    "description": "Updated SDN controller configuration",
    "ip": "192.168.1.100",
    "username": "admin",
    "password": "newpassword",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
名字 类型 描述 起始版本
success boolean 5.4.0
inventory SdnControllerInventory

详情参考inventory

5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.4.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
vendorType String 5.4.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
ip String 5.4.0
username String 5.4.0
password String 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
status SdnControllerStatus 详情参考status 5.4.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0

SDK示例

Java SDK
ChangeSdnControllerAction action = new ChangeSdnControllerAction();
action.uuid = "fde0b2acbe6c3c7192e32d113f4e00b8";
action.userName = "sdnuser";
action.password = "newpassword";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeSdnControllerAction.Result res = action.call();
Python SDK
ChangeSdnControllerAction action = ChangeSdnControllerAction()
action.uuid = "fde0b2acbe6c3c7192e32d113f4e00b8"
action.userName = "sdnuser"
action.password = "newpassword"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeSdnControllerAction.Result res = action.call()

拉取SDN控制器租户(PullSdnControllerTenant)

API请求

URLs
PUT zstack/v1/sdn-controllers/{uuid}/tenant/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "pullSdnControllerTenant": {},
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"pullSdnControllerTenant":{}}' http://localhost:8080/zstack/v1/sdn-controllers/6d53fa409b343fc8a231c100e3f3c90f/tenant/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.3.28
systemTags (可选) List body 系统标签 5.3.28
userTags (可选) List body 用户标签 5.3.28

API返回

返回示例
{
  "inventories": []
}
名字 类型 描述 起始版本
success boolean 5.3.28
inventories List 详情参考inventories 5.3.28
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 5.3.28
#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
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.3.28
sdnControllerUuid String 5.3.28
tenantUuid String 5.3.28
vdsUuid String 5.3.28
tenantName String 5.3.28
vdsName String 5.3.28
cloudDomainName String 5.3.28
status String 5.3.28
createDate Timestamp 创建时间 5.3.28
lastOpDate Timestamp 最后一次修改时间 5.3.28

SDK示例

Java SDK
PullSdnControllerTenantAction action = new PullSdnControllerTenantAction();
action.uuid = "6d53fa409b343fc8a231c100e3f3c90f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PullSdnControllerTenantAction.Result res = action.call();
Python SDK
PullSdnControllerTenantAction action = PullSdnControllerTenantAction()
action.uuid = "6d53fa409b343fc8a231c100e3f3c90f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
PullSdnControllerTenantAction.Result res = action.call()

创建华为SDN虚拟路由器(CreateHuaweiIMasterVRouter)

API请求

URLs
POST zstack/v1/sdn-controller/huawei-imaster/vrouters
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "test-vrouter",
    "description": "Test VRouter for Huawei iMaster",
    "huaweiVpcUuid": "67ed6b0065633829892c11ccf1ee2dba"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"test-vrouter","description":"Test VRouter for Huawei iMaster","huaweiVpcUuid":"67ed6b0065633829892c11ccf1ee2dba"}}' http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vrouters
参数列表
名字 类型 位置 描述 可选值 起始版本
name String body(包含在params结构中) 资源名称 5.4.0
description (可选) String body(包含在params结构中) 资源的详细描述 5.4.0
huaweiVpcUuid String body(包含在params结构中) 5.4.0
resourceUuid (可选) String body(包含在params结构中) 资源UUID 5.4.0
tagUuids (可选) List body(包含在params结构中) 标签UUID列表 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.4.0

API返回

返回示例
{
  "inventory": {
    "uuid": "5a7236affa1f34d7908972b14956b18b",
    "name": "test-vrouter",
    "description": "Test VRouter for Huawei iMaster",
    "logicalNetworkId": "605a782332663c769f1845ac76efc526",
    "tenantId": "3350497bb7393700b77bc28d625468d8",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
名字 类型 描述 起始版本
success boolean 5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.4.0
inventory HuaweiIMasterVRouterInventory 详情参考inventory 5.4.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
logicalNetworkId String 5.4.0
tenantId String 5.4.0
fabricUuid String 5.4.0
deleted Boolean 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0

SDK示例

Java SDK
CreateHuaweiIMasterVRouterAction action = new CreateHuaweiIMasterVRouterAction();
action.name = "test-vrouter";
action.description = "Test VRouter for Huawei iMaster";
action.huaweiVpcUuid = "67ed6b0065633829892c11ccf1ee2dba";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateHuaweiIMasterVRouterAction.Result res = action.call();
Python SDK
CreateHuaweiIMasterVRouterAction action = CreateHuaweiIMasterVRouterAction()
action.name = "test-vrouter"
action.description = "Test VRouter for Huawei iMaster"
action.huaweiVpcUuid = "67ed6b0065633829892c11ccf1ee2dba"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateHuaweiIMasterVRouterAction.Result res = action.call()

删除华为SDN虚拟路由器(DeleteHuaweiIMasterVRouter)

API请求

URLs
DELETE zstack/v1/sdn-controller/huawei-imaster/vrouters/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vrouters/523c2083fec532b79fbc3701909e3b25
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.4.0
sdnControllerUuid (可选) String body 5.4.0
deleteMode (可选) String body 删除模式(Permissive / Enforcing,Permissive) 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.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
DeleteHuaweiIMasterVRouterAction action = new DeleteHuaweiIMasterVRouterAction();
action.uuid = "523c2083fec532b79fbc3701909e3b25";
action.sdnControllerUuid = "6f0803e4276a38308d958c2d8dc7381c";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHuaweiIMasterVRouterAction.Result res = action.call();
Python SDK
DeleteHuaweiIMasterVRouterAction action = DeleteHuaweiIMasterVRouterAction()
action.uuid = "523c2083fec532b79fbc3701909e3b25"
action.sdnControllerUuid = "6f0803e4276a38308d958c2d8dc7381c"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHuaweiIMasterVRouterAction.Result res = action.call()

查询华为SDN虚拟路由器(QueryHuaweiIMasterVRouter)

API请求

URLs
GET zstack/v1/sdn-controller/huawei-imaster/vrouters
GET zstack/v1/sdn-controller/huawei-imaster/vrouters/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vroutersq=uuid=6a3128b0ec823829ae6dbbdd9e59122e
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vrouters/c59afc7c9cb739bab4286803ba3536fd

可查询字段

运行CLI命令行工具,输入QueryHuaweiIMasterVRouter并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "e75a229874b23b35903e52a6f52059cb",
      "name": "vrouter1",
      "description": "vrouter for test",
      "logicalNetworkId": "87ed0075640733c291aa223772d9d82d",
      "tenantId": "2f4c1e3a62fa3da1ab1cca8b53074b9f"
    }
  ]
}
名字 类型 描述 起始版本
success boolean 5.4.0
inventories List 详情参考inventories 5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 5.4.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
logicalNetworkId String 5.4.0
tenantId String 5.4.0
fabricUuid String 5.4.0
deleted Boolean 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0

SDK示例

Java SDK
QueryHuaweiIMasterVRouterAction action = new QueryHuaweiIMasterVRouterAction();
action.conditions = asList("uuid=5accb3ddb5b1343b81617f13d13a3632");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHuaweiIMasterVRouterAction.Result res = action.call();
Python SDK
QueryHuaweiIMasterVRouterAction action = QueryHuaweiIMasterVRouterAction()
action.conditions = ["uuid=dd650dbcf99931a9a9bd442b2b3e4f0d"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHuaweiIMasterVRouterAction.Result res = action.call()

删除华为SDN租户(DeleteHuaweiIMasterTenant)

API请求

URLs
DELETE zstack/v1/sdn-controller/huawei-imaster/tenants/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/tenants/082fa02e39d53778a21a7e86b044ce17
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.4.0
sdnControllerUuid (可选) String body 指定的华为iMaster租户 5.4.0
deleteMode (可选) String body 删除模式(Permissive / Enforcing,Permissive) 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.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
DeleteHuaweiIMasterTenantAction action = new DeleteHuaweiIMasterTenantAction();
action.uuid = "082fa02e39d53778a21a7e86b044ce17";
action.sdnControllerUuid = "2969528393513dcb812b38947a2ff3bc";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHuaweiIMasterTenantAction.Result res = action.call();
Python SDK
DeleteHuaweiIMasterTenantAction action = DeleteHuaweiIMasterTenantAction()
action.uuid = "082fa02e39d53778a21a7e86b044ce17"
action.sdnControllerUuid = "2969528393513dcb812b38947a2ff3bc"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHuaweiIMasterTenantAction.Result res = action.call()

查询华为SDN租户(QueryHuaweiIMasterTenant)

API请求

URLs
GET zstack/v1/sdn-controller/huawei-imaster/tenants
GET zstack/v1/sdn-controller/huawei-imaster/tenants/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/tenants?q=uuid=a611c5dc7e463ffaab957ebfc51e2afe
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/tenants/756bdfbf03b336f8863fa39595ffb7ca

可查询字段

运行CLI命令行工具,输入QueryHuaweiIMasterTenant并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "4ca38813eb493b34a95f9f506c97f92d",
      "name": "tenant1",
      "description": "sdn for test",
      "fabricIds": [
        "5c9a525042c53d559350692d45de92b3"
      ]
    }
  ]
}
名字 类型 描述 起始版本
success boolean 操作是否成功 5.4.0
inventories List 详情参考inventories 5.4.0
error ErrorCode 详情参考error 5.4.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
fabricIds String 5.4.0
sdnControllerUuid String 5.4.0
deleted Boolean 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0

SDK示例

Java SDK
QueryHuaweiIMasterTenantAction action = new QueryHuaweiIMasterTenantAction();
action.conditions = asList("uuid=d57c6fedabbf3a5b91e543f5cf1c9980");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHuaweiIMasterTenantAction.Result res = action.call();
Python SDK
QueryHuaweiIMasterTenantAction action = QueryHuaweiIMasterTenantAction()
action.conditions = ["uuid=3295ba081400315ea46f1f074b850933"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHuaweiIMasterTenantAction.Result res = action.call()

删除华为SDN VPC(DeleteHuaweiIMasterVpc)

API请求

URLs
DELETE zstack/v1/sdn-controller/huawei-imaster/vpcs/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vpcs/7daed678898c31968176551f0b718ab6
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.4.0
sdnControllerUuid String body 5.4.0
deleteMode (可选) String body 删除模式(Permissive / Enforcing,Permissive) 5.4.0
systemTags(可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.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
DeleteHuaweiIMasterVpcAction action = new DeleteHuaweiIMasterVpcAction();
action.uuid = "7daed678898c31968176551f0b718ab6";
action.sdnControllerUuid = "34bab7bf172633e78e54fdefdc5c0b6e";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHuaweiIMasterVpcAction.Result res = action.call();
Python SDK
DeleteHuaweiIMasterVpcAction action = DeleteHuaweiIMasterVpcAction()
action.uuid = "7daed678898c31968176551f0b718ab6"
action.sdnControllerUuid = "34bab7bf172633e78e54fdefdc5c0b6e"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHuaweiIMasterVpcAction.Result res = action.call()

查询华为SDN VPC(QueryHuaweiIMasterVpc)

API请求

URLs
GET zstack/v1/sdn-controller/huawei-imaster/vpcs
GET zstack/v1/sdn-controller/huawei-imaster/vpcs/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vpcs?q=uuid=94ca3286f3e43125a09243d352c9428d
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/vpcs/e1101c95aee93111bc47ce3b83727169

可查询字段

运行CLI命令行工具,输入QueryHuaweiIMasterVpc并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "1e7388c5359a3809b87bfe9c9c891061",
      "name": "vpc1",
      "description": "vpc for test",
      "tenantId": "07b9992d75a635619bac0bac52aac5bd",
      "fabricId": "a5bfb6a007c5380bb244975552fd9528"
    }
  ]
}
名字 类型 描述 起始版本
success boolean 操作是否成功 5.4.0
inventories List 详情参考inventories 5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 5.4.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
tenantId String 租户标识符 5.4.0
fabricId String fabric标识符 5.4.0
sdnControllerUuid String SDN控制器UUID 5.4.0
deleted Boolean 删除标记 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0

SDK示例

Java SDK
QueryHuaweiIMasterVpcAction action = new QueryHuaweiIMasterVpcAction();
action.conditions = asList("uuid=1949ad5872293963b8bc71047b5efa71");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHuaweiIMasterVpcAction.Result res = action.call();
Python SDK
QueryHuaweiIMasterVpcAction action = QueryHuaweiIMasterVpcAction()
action.conditions = ["uuid=af61d2ecb4f93f98b0d75c7e1c3cff25"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHuaweiIMasterVpcAction.Result res = action.call()

删除华为SDN Fabric(DeleteHuaweiIMasterFabric)

API请求

URLs
DELETE zstack/v1/sdn-controller/huawei-imaster/fabrics/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/fabrics/1aa09d25169430c2a01ec3f1b6f1ff67
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.4.0
sdnControllerUuid (可选) String body 5.4.0
deleteMode (可选) String body 删除模式(Permissive / Enforcing,Permissive) 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.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
DeleteHuaweiIMasterFabricAction action = new DeleteHuaweiIMasterFabricAction();
action.uuid = "1aa09d25169430c2a01ec3f1b6f1ff67";
action.sdnControllerUuid = "7b50926063c439b4ba2b2da766b6dc67";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteHuaweiIMasterFabricAction.Result res = action.call();
Python SDK
DeleteHuaweiIMasterFabricAction action = DeleteHuaweiIMasterFabricAction()
action.uuid = "1aa09d25169430c2a01ec3f1b6f1ff67"
action.sdnControllerUuid = "7b50926063c439b4ba2b2da766b6dc67"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteHuaweiIMasterFabricAction.Result res = action.call()

查询华为SDN Fabric(QueryHuaweiIMasterFabric)

API请求

URLs
GET zstack/v1/sdn-controller/huawei-imaster/fabrics
GET zstack/v1/sdn-controller/huawei-imaster/fabrics/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/fabrics?q=uuid=838b4d7e1c6937b08065c471fcdb5d03
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/fabrics/99e0f6310d3f3a75ad1856fff8014061

可查询字段

运行CLI命令行工具,输入QueryHuaweiIMasterFabric并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "74c62e19bc8f3792979d2d70b7af53a4",
      "name": "fabric",
      "description": "fabric for test"
    }
  ]
}
名字 类型 描述 起始版本
success boolean 5.4.0
inventories List 详情参考inventories 5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.4.0
#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
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
sdnControllerUuid String SDN控制器UUID 5.4.0
deleted Boolean 删除标记 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0

SDK示例

Java SDK
QueryHuaweiIMasterFabricAction action = new QueryHuaweiIMasterFabricAction();
action.conditions = asList("uuid=f9aae037a6cf38b68374e7b1c8d3e65b");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHuaweiIMasterFabricAction.Result res = action.call();
Python SDK
QueryHuaweiIMasterFabricAction action = QueryHuaweiIMasterFabricAction()
action.conditions = ["uuid=1b1c880dd7f43329affa520bfcbe635b"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHuaweiIMasterFabricAction.Result res = action.call()

重连SDN控制器(ReconnectSdnController)

API请求

URLs
PUT zstack/v1/sdn-controllers/{sdnControllerUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "reconnectSdnController": {},
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"reconnectSdnController":{}}' http://localhost:8080/zstack/v1/sdn-controllers/911e4bc69d453bf89aae865ea6878263/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
sdnControllerUuid String url 5.3.0
systemTags (可选) List body 系统标签 5.3.0
userTags (可选) List body 用户标签 5.3.0

API返回

返回示例
{
  "inventory": {
    "uuid": "65eede773d4a340681558318aabdc6a5",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 5.3.0
inventory SdnControllerInventory 详情参考inventory 5.3.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器Uuid 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0
#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

SDK示例

Java SDK
ReconnectSdnControllerAction action = new ReconnectSdnControllerAction();
action.sdnControllerUuid = "911e4bc69d453bf89aae865ea6878263";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ReconnectSdnControllerAction.Result res = action.call();
Python SDK
ReconnectSdnControllerAction action = ReconnectSdnControllerAction()
action.sdnControllerUuid = "911e4bc69d453bf89aae865ea6878263"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ReconnectSdnControllerAction.Result res = action.call()

更新SDN控制器(UpdateSdnController)

API请求

URLs
PUT zstack/v1/sdn-controllers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateSdnController": {
    "name": "Test-Net",
    "description": "Test"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateSdnController":{"name":"Test-Net","description":"Test"}}' http://localhost:8080/zstack/v1/sdn-controllers/4a39301758b13cda968bdcd866452d14/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 3.7.0
name (可选) String body(包含在updateSdnController结构中) 资源名称 3.7.0
description (可选) String body(包含在updateSdnController结构中) 资源的详细描述 3.7.0
systemTags (可选) List body 3.7.0
userTags (可选) List body 3.7.0

API返回

返回示例
{
  "inventory": {
    "uuid": "722428da8bac30d2b75daa2f6cd34e9d",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 0.6
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 3.7.0
inventory SdnControllerInventory 详情参考inventory 3.7.0
#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
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7
vendorType String 3.7
vendorVersion String 厂商版本 5.4
name String 资源名称 3.7
description String 资源的详细描述 3.7
ip String 3.7
username String 3.7
password String 3.7
createDate Timestamp 创建时间 3.7
lastOpDate Timestamp 最后一次修改时间 3.7
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0

SDK示例

Java SDK
UpdateSdnControllerAction action = new UpdateSdnControllerAction();
action.uuid = "4a39301758b13cda968bdcd866452d14";
action.name = "Test-Net";
action.description = "Test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSdnControllerAction.Result res = action.call();
Python SDK
UpdateSdnControllerAction action = UpdateSdnControllerAction()
action.uuid = "4a39301758b13cda968bdcd866452d14"
action.name = "Test-Net"
action.description = "Test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSdnControllerAction.Result res = action.call()

拉取华为SDN最新配置(PullHuaweiIMasterController)

API请求

URLs
PUT zstack/v1/sdn-controller/huawei-imaster/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "pullHuaweiIMasterController": {
    "pullSwitch": false
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"pullHuaweiIMasterController":{"pullSwitch":false}}' http://localhost:8080/zstack/v1/sdn-controller/huawei-imaster/10b101c6b2583c1ab6a08c4ea6962d6a/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 5.4.0
pullSwitch (可选) boolean body(包含在pullHuaweiIMasterController结构中) 是否拉取交换机信息 5.4.0
systemTags (可选) List body 系统标签 5.4.0
userTags (可选) List body 用户标签 5.4.0

API返回

返回示例
{
  "inventories": []
}
名字 类型 描述 起始版本
success boolean 5.4.0
inventories List 详情参考inventories 5.4.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 5.4.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.4.0
description String 错误的概要描述 5.4.0
details String 错误的详细信息 5.4.0
elaboration String 保留字段,默认为null 5.4.0
opaque LinkedHashMap 保留字段,默认为null 5.4.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.4.0
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
vendorType String 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
ip String 5.4.0
username String 5.4.0
password String 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
fabrics List 详情参考fabrics 5.4.0
tenants List 详情参考tenants 5.4.0
vpcs List 详情参考vpcs 5.4.0
vrouters List 详情参考vrouters 5.4.0
status SdnControllerStatus 详情参考status 5.4.0
vniRanges List 详情参考vniRanges 5.4.0
vxlanPools List 详情参考vxlanPools 5.4.0
hostRefs List 详情参考hostRefs 5.4.0
#fabrics
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
sdnControllerUuid String SDN控制器UUID 5.4.0
deleted Boolean 删除标记 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
#tenants
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
fabricIds String 5.4.0
sdnControllerUuid String 5.4.0
deleted Boolean 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
#vpcs
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
tenantId String 租户标识符 5.4.0
fabricId String fabric标识符 5.4.0
sdnControllerUuid String SDN控制器UUID 5.4.0
deleted Boolean 删除标记 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
#vrouters
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
logicalNetworkId String 5.4.0
tenantId String 5.4.0
fabricUuid String 5.4.0
deleted Boolean 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.4.0
Connected SdnControllerStatus 已连接 5.4.0
Disconnected SdnControllerStatus 已失联 5.4.0
#vniRanges
名字 类型 描述 起始版本
startVni Integer 5.4.0
endVni Integer 5.4.0
#vxlanPools
名字 类型 描述 起始版本
sdnControllerUuid String 5.4.0
attachedCidrs Map 5.4.0
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
zoneUuid String 区域UUID 5.4.0
physicalInterface String 5.4.0
type String 5.4.0
vSwitchType String 5.4.0
virtualNetworkId Integer 5.4.0
isolated Boolean 5.4.0
pvlan String 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
attachedClusterUuids List 5.4.0
attachedVtepRefs List 详情参考attachedVtepRefs 5.4.0
remoteVteps List 详情参考remoteVteps 5.4.0
attachedVxlanNetworkRefs List 详情参考attachedVxlanNetworkRefs 5.4.0
attachedVniRanges List 详情参考attachedVniRanges 5.4.0
#attachedVtepRefs
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
hostUuid String 物理机UUID 5.4.0
vtepIp String 5.4.0
port Integer 5.4.0
type String 5.4.0
physicalInterface String 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
poolUuid String VXLAN资源池UUID 5.4.0
#remoteVteps
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
clusterUuid String 集群UUID 5.4.0
vtepIp String 隧道端点IP地址 5.4.0
port Integer 端口 5.4.0
type String 类型 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
poolUuid String VXLAN资源池UUID 5.4.0
#attachedVxlanNetworkRefs
名字 类型 描述 起始版本
vni Integer Vni号 5.4.0
poolUuid String VXLAN资源池UUID 5.4.0
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
zoneUuid String 区域UUID 5.4.0
physicalInterface String 物理网卡 5.4.0
type String 二层网络类型 5.4.0
vSwitchType String 5.4.0
virtualNetworkId Integer 5.4.0
isolated Boolean 5.4.0
pvlan String 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
attachedClusterUuids List 挂载集群的UUID列表 5.4.0
#attachedVniRanges
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.4.0
name String 资源名称 5.4.0
description String 资源的详细描述 5.4.0
startVni Integer 起始Vni 5.4.0
endVni Integer 结束Vni 5.4.0
createDate Timestamp 创建时间 5.4.0
lastOpDate Timestamp 最后一次修改时间 5.4.0
l2NetworkUuid String 二层网络UUID 5.4.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String 资源的UUID,唯一标示该资源 5.4.0
hostUuid String 物理机UUID 5.4.0
vSwitchType String 虚拟交换机类型 5.4.0
vtepIp String 物理机VTEP IP 5.4.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.4.0
nicDrivers String 物理机网卡和驱动类型映射 5.4.0
netmask String 物理机VTEP IP掩码 5.4.0
bondMode String 物理机网卡bond模式 5.4.0
lacpMode String 物理机网卡LACP模式 5.4.0

SDK示例

Java SDK
PullHuaweiIMasterControllerAction action = new PullHuaweiIMasterControllerAction();
action.uuid = "10b101c6b2583c1ab6a08c4ea6962d6a";
action.pullSwitch = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
PullHuaweiIMasterControllerAction.Result res = action.call();
Python SDK
PullHuaweiIMasterControllerAction action = PullHuaweiIMasterControllerAction()
action.uuid = "10b101c6b2583c1ab6a08c4ea6962d6a"
action.pullSwitch = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
PullHuaweiIMasterControllerAction.Result res = action.call()

SDN控制器绑定物理机(SdnControllerAddHost)

API请求

URLs
POST zstack/v1/sdn-controllers/{sdnControllerUuid}/hosts/{hostUuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST http://localhost:8080/zstack/v1/sdn-controllers/13dced0afb8d3bb4ad238eb476eca64e/hosts/1f4e13ef459c39968a10f79cc5905ea4
参数列表
名字 类型 位置 描述 可选值 起始版本
sdnControllerUuid String url SDN控制器UUID 5.3.0
hostUuid String url 物理机UUID 5.3.0
vSwitchType (可选) String body 虚拟交换机类型
  • OvsKernel
  • OvsDpdk
  • SRIOV
5.3.0
nicNames List body 物理机网卡名称列表 5.3.0
vtepIp (可选) String body 物理机VTEP IP 5.3.0
systemTags (可选) List body 系统标签 5.3.0
userTags (可选) List body 用户标签 5.3.0
netmask (可选) String body 物理机VTEP IP掩码 5.3.0
bondMode (可选) String body 物理机网卡bond模式 5.3.0
lacpMode (可选) String body 物理机网卡LACP模式 5.3.0

API返回

返回示例
{
  "inventory": {
    "uuid": "2b317c278d253df6bab1acd9b293d957",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 5.3.0
inventory SdnControllerInventory 详情参考inventory 5.3.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器Uuid 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0
#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

SDK示例

Java SDK
SdnControllerAddHostAction action = new SdnControllerAddHostAction();
action.sdnControllerUuid = "13dced0afb8d3bb4ad238eb476eca64e";
action.hostUuid = "1f4e13ef459c39968a10f79cc5905ea4";
action.vSwitchType = "H3C VCFC";
action.vtepIp = "192.168.1.101";
action.netmask = "ens1 ens2";
action.bondMode = "active-backup";
action.lacpMode = "off";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SdnControllerAddHostAction.Result res = action.call();
Python SDK
SdnControllerAddHostAction action = SdnControllerAddHostAction()
action.sdnControllerUuid = "13dced0afb8d3bb4ad238eb476eca64e"
action.hostUuid = "1f4e13ef459c39968a10f79cc5905ea4"
action.vSwitchType = "H3C VCFC"
action.vtepIp = "192.168.1.101"
action.netmask = "ens1 ens2"
action.bondMode = "active-backup"
action.lacpMode = "off"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SdnControllerAddHostAction.Result res = action.call()

SDN控制器更改物理机(SdnControllerChangeHost)

API请求

URLs
PUT zstack/v1/sdn-controllers/{sdnControllerUuid}/hosts/{hostUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "sdnControllerChangeHost": {
    "vSwitchType": "H3C VCFC",
    "vtepIp": "192.168.1.101",
    "netmask": "ens1 ens2",
    "bondMode": "active-backup",
    "lacpMode": "off"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"sdnControllerChangeHost":{"vSwitchType":"H3C VCFC","vtepIp":"192.168.1.101","netmask":"ens1 ens2","bondMode":"active-backup","lacpMode":"off"}}' http://localhost:8080/zstack/v1/sdn-controllers/51a894d84f22366eb0ff853748f7cb1d/hosts/772b68aff57f3bbb82c40d569d6bc76a/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
sdnControllerUuid String url SDN控制器UUID 5.3.0
hostUuid String url 物理机UUID 5.3.0
vSwitchType (可选) String body(包含在sdnControllerChangeHost结构中) 虚拟交换机类型
  • OvnDpdk
  • OvnKernel
5.3.0
nicNames (可选) List body(包含在sdnControllerChangeHost结构中) 物理机网卡名称列表 5.3.0
vtepIp (可选) String body(包含在sdnControllerChangeHost结构中) 物理机VTEP IP 5.3.0
netmask (可选) String body(包含在sdnControllerChangeHost结构中) 物理机VTEP IP掩码 5.3.0
bondMode (可选) String body(包含在sdnControllerChangeHost结构中) 物理机网卡bond模式 5.3.0
lacpMode (可选) String body(包含在sdnControllerChangeHost结构中) 物理机网卡LACP模式 5.3.0
systemTags (可选) List body 系统标签 5.3.0
userTags (可选) List body 用户标签 5.3.0

API返回

返回示例
{
  "inventory": {
    "uuid": "b2d35464d0db3362b605c1e79814f237",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 5.3.0
inventory SdnControllerInventory 详情参考inventory 5.3.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器UUID 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0
#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

SDK示例

Java SDK
SdnControllerChangeHostAction action = new SdnControllerChangeHostAction();
action.sdnControllerUuid = "51a894d84f22366eb0ff853748f7cb1d";
action.hostUuid = "772b68aff57f3bbb82c40d569d6bc76a";
action.vSwitchType = "H3C VCFC";
action.vtepIp = "192.168.1.101";
action.netmask = "ens1 ens2";
action.bondMode = "active-backup";
action.lacpMode = "off";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SdnControllerChangeHostAction.Result res = action.call();
Python SDK
SdnControllerChangeHostAction action = SdnControllerChangeHostAction()
action.sdnControllerUuid = "51a894d84f22366eb0ff853748f7cb1d"
action.hostUuid = "772b68aff57f3bbb82c40d569d6bc76a"
action.vSwitchType = "H3C VCFC"
action.vtepIp = "192.168.1.101"
action.netmask = "ens1 ens2"
action.bondMode = "active-backup"
action.lacpMode = "off"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SdnControllerChangeHostAction.Result res = action.call()

SDN控制器解绑物理机 (SdnControllerRemoveHost)

API请求

URLs
DELETE zstack/v1/sdn-controllers/{sdnControllerUuid}/hosts/{hostUuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controllers/2adbaedc05a03129bd055ba7a3f045cc/hosts/1fb1da4d101335b2b981f0b107ac7ba8
参数列表
名字 类型 位置 描述 可选值 起始版本
sdnControllerUuid String url SDN控制器UUID 5.3.0
hostUuid String url 物理机UUID 5.3.0
vSwitchType (可选) String body 虚拟交换机类型
  • OvnDpdk
  • OvnKernel
5.3.0
systemTags (可选) List body 系统标签 5.3.0
userTags (可选) List body 用户标签 5.3.0

API返回

返回示例
{
  "inventory": {
    "uuid": "5aedd20ff2883bca8bdcc0dd7a46e779",
    "vendorType": "H3C VCFC",
    "name": "sdn-1",
    "description": "sdn controller from vendor",
    "ip": "192.168.1.1",
    "username": "admin",
    "password": "password"
  }
}
名字 类型 描述 起始版本
success boolean 5.3.0
inventory SdnControllerInventory 详情参考inventory 5.3.0
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.0
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.7.0
vendorType String 3.7.0
vendorVersion String 厂商版本 5.4.0
name String 资源名称 3.7.0
description String 资源的详细描述 3.7.0
ip String 3.7.0
username String 3.7.0
password String 3.7.0
createDate Timestamp 创建时间 3.7.0
lastOpDate Timestamp 最后一次修改时间 3.7.0
status SdnControllerStatus 详情参考status 5.3.0
hostRefs List 详情参考hostRefs 5.3.0
#status
名字 类型 描述 起始版本
Connecting SdnControllerStatus 连接中 5.3.0
Connected SdnControllerStatus 已连接 5.3.0
Disconnected SdnControllerStatus 已失联 5.3.0
#hostRefs
名字 类型 描述 起始版本
sdnControllerUuid String SDN控制器UUID 5.3.0
hostUuid String 物理机UUID 5.3.0
vSwitchType String 虚拟交换机类型 5.3.0
vtepIp String 物理机VTEP IP 5.3.0
nicPciAddresses String 物理机网卡和PCI地址映射 5.3.0
nicDrivers String 物理机网卡和驱动类型映射 5.3.0
netmask String 物理机VTEP IP掩码 5.3.0
bondMode String 物理机网卡bond模式 5.3.0
lacpMode String 物理机网卡LACP模式 5.3.0
#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

SDK示例

Java SDK
SdnControllerRemoveHostAction action = new SdnControllerRemoveHostAction();
action.sdnControllerUuid = "2adbaedc05a03129bd055ba7a3f045cc";
action.hostUuid = "1fb1da4d101335b2b981f0b107ac7ba8";
action.vSwitchType = "OvnDpdk";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SdnControllerRemoveHostAction.Result res = action.call();
Python SDK
SdnControllerRemoveHostAction action = SdnControllerRemoveHostAction()
action.sdnControllerUuid = "2adbaedc05a03129bd055ba7a3f045cc"
action.hostUuid = "1fb1da4d101335b2b981f0b107ac7ba8"
action.vSwitchType = "OvnDpdk"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SdnControllerRemoveHostAction.Result res = action.call()

创建OVN控制器实例(CreateOvnControllerVm)

API请求

URLs
POST zstack/v1/ovn/instances
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "zstack ovn controller",
    "description": "this is a sdn controller instance",
    "strategy": "InstantStart"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"zstack ovn controller","description":"this is a sdn controller instance","strategy":"InstantStart"}}' http://localhost:8080/zstack/v1/ovn/instances
参数列表
名字 类型 位置 描述 可选值 起始版本
name String body(包含在params结构中) OVN控制器实例名称 5.3.20
instanceOfferingUuid (可选) String body(包含在params结构中) OVN控制器规格UUID 5.3.20
cpuNum (可选) Integer body(包含在params结构中) 5.3.20
memorySize (可选) Long body(包含在params结构中) 5.3.20
reservedMemorySize (可选) Long body(包含在params结构中) 5.3.20
imageUuid (可选) String body(包含在params结构中) 镜像UUID 5.3.20
l3NetworkUuids (可选) List body(包含在params结构中) 5.3.20
vmNicParams (可选) String body(包含在params结构中) 5.3.20
type (可选) String body(包含在params结构中)
  • UserVm
  • ApplianceVm
5.3.20
rootDiskOfferingUuid (可选) String body(包含在params结构中) 5.3.20
rootDiskSize (可选) Long body(包含在params结构中) 5.3.20
dataDiskSizes (可选) List body(包含在params结构中) 5.3.20
dataDiskOfferingUuids (可选) List body(包含在params结构中) 5.3.20
zoneUuid (可选) String body(包含在params结构中) 区域UUID 5.3.20
clusterUuid (可选) String body(包含在params结构中) 集群UUID 5.3.20
hostUuid (可选) String body(包含在params结构中) 物理机UUID 5.3.20
primaryStorageUuidForRootVolume (可选) String body(包含在params结构中) 5.3.20
description (可选) String body(包含在params结构中) 资源的详细描述 5.3.20
defaultL3NetworkUuid (可选) String body(包含在params结构中) 5.3.20
strategy (可选) String body(包含在params结构中)
  • InstantStart
  • JustCreate
  • CreateStopped
5.3.20
rootVolumeSystemTags (可选) List body(包含在params结构中) 5.3.20
dataVolumeSystemTags (可选) List body(包含在params结构中) 5.3.20
dataVolumeSystemTagsOnIndex (可选) Map body(包含在params结构中) 5.3.20
sshKeyPairUuids (可选) List body(包含在params结构中) 5.3.20
platform (可选) String body(包含在params结构中)
  • Linux
  • Windows
  • Other
  • Paravirtualization
  • WindowsVirtio
5.3.20
guestOsType (可选) String body(包含在params结构中) 5.3.20
architecture (可选) String body(包含在params结构中)
  • x86_64
  • aarch64
  • mips64el
  • loongarch64
5.3.20
virtio (可选) Boolean body(包含在params结构中) 5.3.20
diskAOs (可选) List body(包含在params结构中) 5.3.20
resourceUuid (可选) String body(包含在params结构中) 资源UUID 5.3.20
tagUuids (可选) List body(包含在params结构中) 标签UUID列表 5.3.20
systemTags (可选) List body 系统标签 5.3.20
userTags (可选) List body 用户标签 5.3.20

API返回

返回示例
{
  "inventory": {}
}
名字 类型 描述 起始版本
success Boolean 5.3.20
inventory ApplianceVmInventory 详情参考inventory 5.3.20
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.20
#inventory
名字 类型 描述 起始版本
applianceVmType String 5.3.20
managementNetworkUuid String 5.3.20
defaultRouteL3NetworkUuid String 5.3.20
status String 5.3.20
agentPort Integer 5.3.20
uuid String 资源的UUID,唯一标示该资源 5.3.20
name String 资源名称 5.3.20
description String 资源的详细描述 5.3.20
zoneUuid String 区域UUID 5.3.20
clusterUuid String 集群UUID 5.3.20
imageUuid String 镜像UUID 5.3.20
hostUuid String 物理机UUID 5.3.20
lastHostUuid String 5.3.20
instanceOfferingUuid String 计算规格UUID 5.3.20
rootVolumeUuid String 根云盘UUID 5.3.20
platform String 5.3.20
defaultL3NetworkUuid String 5.3.20
type String 5.3.20
hypervisorType String 5.3.20
memorySize Long 5.3.20
cpuNum Integer 5.3.20
cpuSpeed Long 5.3.20
allocatorStrategy String 5.3.20
createDate Timestamp 创建时间 5.3.20
lastOpDate Timestamp 最后一次修改时间 5.3.20
state String 5.3.20
vmNics List 详情参考vmNics 5.3.20
allVolumes List 详情参考allVolumes 5.3.20
#vmNics
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.3.20
vmInstanceUuid String 云主机UUID 5.3.20
l3NetworkUuid String 三层网络UUID 5.3.20
ip String 5.3.20
mac String 5.3.20
hypervisorType String 5.3.20
netmask String 5.3.20
gateway String 5.3.20
metaData String 5.3.20
ipVersion Integer 5.3.20
driverType String 5.3.20
internalName String 5.3.20
deviceId Integer 5.3.20
type String 5.3.20
state String 网卡状态 5.3.20
createDate Timestamp 创建时间 5.3.20
lastOpDate Timestamp 最后一次修改时间 5.3.20
usedIps List 详情参考usedIps 5.3.20
#usedIps
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.3.20
ipRangeUuid String IP段UUID 5.3.20
l3NetworkUuid String 三层网络UUID 5.3.20
ipVersion Integer 5.3.20
ip String 5.3.20
netmask String 5.3.20
gateway String 5.3.20
usedFor String 分配原因 5.3.20
ipInLong long 5.3.20
ipInBinary byte[] 5.3.20
vmNicUuid String 云主机网卡UUID 5.3.20
createDate Timestamp 创建时间 5.3.20
lastOpDate Timestamp 最后一次修改时间 5.3.20
#allVolumes
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.3.20
name String 资源名称 5.3.20
description String 资源的详细描述 5.3.20
primaryStorageUuid String 主存储UUID 5.3.20
vmInstanceUuid String 云主机UUID 5.3.20
diskOfferingUuid String 云盘规格UUID 5.3.20
rootImageUuid String 5.3.20
installPath String 5.3.20
type String 5.3.20
format String 5.3.20
size Long 5.3.20
actualSize Long 5.3.20
deviceId Integer 5.3.20
state String 5.3.20
status String 5.3.20
createDate Timestamp 创建时间 5.3.20
lastOpDate Timestamp 最后一次修改时间 5.3.20
isShareable Boolean 5.3.20
volumeQos String 5.3.20
lastDetachDate Timestamp 5.3.20
lastVmInstanceUuid String 5.3.20
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.3.20
description String 错误的概要描述 5.3.20
details String 错误的详细信息 5.3.20
elaboration String 保留字段,默认为null 5.3.20
opaque LinkedHashMap 保留字段,默认为null 5.3.20
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.3.20

SDK示例

Java SDK
CreateOvnControllerVmAction action = new CreateOvnControllerVmAction();
action.name = "zstack ovn controller";
action.description = "this is a sdn controller instance";
action.strategy = "InstantStart";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateOvnControllerVmAction.Result res = action.call();
Python SDK
CreateOvnControllerVmAction action = CreateOvnControllerVmAction()
action.name = "zstack ovn controller"
action.description = "this is a sdn controller instance"
action.strategy = "InstantStart"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateOvnControllerVmAction.Result res = action.call()

创建OVN控制器规格(CreateOvnControllerOffering)

API请求

URLs
POST zstack/v1/instance-offerings/ovn
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "zoneUuid": "9ea522ec01fc3da286fa47b8a60a0824",
    "managementNetworkUuid": "3302e9bed4e33ab68912cf3d75fcc749",
    "imageUuid": "c2e0cc0faa713de795a079ad7b6470d0",
    "name": "ovn-Offering",
    "cpuNum": 2,
    "memorySize": 1024,
    "reservedMemorySize": 0,
    "sortKey": 0,
    "type": "Ovn"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"zoneUuid":"9ea522ec01fc3da286fa47b8a60a0824","managementNetworkUuid":"3302e9bed4e33ab68912cf3d75fcc749","imageUuid":"c2e0cc0faa713de795a079ad7b6470d0","name":"ovn-Offering","cpuNum":2,"memorySize":1024,"reservedMemorySize":0,"sortKey":0,"type":"Ovn"}}' http://localhost:8080/zstack/v1/instance-offerings/ovn
参数列表
名字 类型 位置 描述 可选值 起始版本
zoneUuid String body(包含在params结构中) 区域UUID 5.3.20
managementNetworkUuid String body(包含在params结构中) 管理网UUID 5.3.20
imageUuid String body(包含在params结构中) 镜像UUID 5.3.20
name String body(包含在params结构中) 规格名称 5.3.20
description (可选) String body(包含在params结构中) 资源的详细描述 5.3.20
cpuNum int body(包含在params结构中) CPU数目 5.3.20
memorySize long body(包含在params结构中) 内存大小,单位Byte 5.3.20
reservedMemorySize (可选) long body(包含在params结构中) 5.3.20
allocatorStrategy (可选) String body(包含在params结构中) 分配策略 5.3.20
sortKey (可选) int body(包含在params结构中) 5.3.20
type (可选) String body(包含在params结构中) 5.3.20
resourceUuid (可选) String body(包含在params结构中) 资源UUID 5.3.20
tagUuids (可选) List body(包含在params结构中) 标签UUID列表 5.3.20
systemTags (可选) List body 系统标签 5.3.20
userTags (可选) List body 用户标签 5.3.20

API返回

返回示例
{
  "inventory": {
    "uuid": "3b0af4671cc93f619ef326a3c99d825c",
    "name": "instanceOffering1",
    "cpuNum": 2,
    "cpuSpeed": 1,
    "type": "UserVm",
    "allocatorStrategy": "Mevoco",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM",
    "state": "Enabled"
  }
}
名字 类型 描述 起始版本
success Boolean 5.3.20
error ErrorCode 错误码,若不为null,则表示操作失败,操作成功时该字段为null。 详情参考error 5.3.20
inventory InstanceOfferingInventory 详情参考inventory 5.3.20
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.3.20
description String 错误的概要描述 5.3.20
details String 错误的详细信息 5.3.20
elaboration String 保留字段,默认为null 5.3.20
opaque LinkedHashMap 保留字段,默认为null 5.3.20
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.3.20
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 5.3.20
name String 资源名称 5.3.20
description String 资源的详细描述 5.3.20
cpuNum Integer CPU数量 5.3.20
cpuSpeed Integer CPU速度 5.3.20
memorySize Long 内存大小 5.3.20
type String 类型 5.3.20
allocatorStrategy String 分配策略 5.3.20
sortKey Integer 5.3.20
createDate Timestamp 创建时间 5.3.20
lastOpDate Timestamp 最后一次修改时间 5.3.20
state String 状态(启用,禁用) 5.3.20

SDK示例

Java SDK
CreateOvnControllerOfferingAction action = new CreateOvnControllerOfferingAction();
action.zoneUuid = "9ea522ec01fc3da286fa47b8a60a0824";
action.managementNetworkUuid = "3302e9bed4e33ab68912cf3d75fcc749";
action.imageUuid = "c2e0cc0faa713de795a079ad7b6470d0";
action.name = "ovn-Offering";
action.cpuNum = 2;
action.memorySize = 1024;
action.reservedMemorySize = 0;
action.sortKey = 0;
action.type = "Ovn";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateOvnControllerOfferingAction.Result res = action.call();
Python SDK
CreateOvnControllerOfferingAction action = CreateOvnControllerOfferingAction()
action.zoneUuid = "9ea522ec01fc3da286fa47b8a60a0824"
action.managementNetworkUuid = "3302e9bed4e33ab68912cf3d75fcc749"
action.imageUuid = "c2e0cc0faa713de795a079ad7b6470d0"
action.name = "ovn-Offering"
action.cpuNum = 2
action.memorySize = 1024
action.reservedMemorySize = 0
action.sortKey = 0
action.type = "Ovn"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateOvnControllerOfferingAction.Result res = action.call()
开发手册 | 5.4.12 | ZStack Cloud · ZCF | ZStack 资源中心