Hardware SDN Controller Operations
AddSdnController
API Request
URLs
POST zstack/v1/sdn-controllersHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"vendorType": "vendor",
"name": "sdn-1",
"description": "sdn controller from vendor",
"ip": "192.168.1.1",
"userName": "admin",
"password": "password"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
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-controllersRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| vendorType | String | body (contained in the params structure) | 3.7.0 | ||
| name | String | body (contained in the params structure) | The resource name. | 3.7.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 3.7.0 | |
| ip | String | body (contained in the params structure) | 3.7.0 | ||
| userName | String | body (contained in the params structure) | 3.7.0 | ||
| password | String | body (contained in the params structure) | 3.7.0 | ||
| resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 3.7.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
Note:
- When you add an SDN controller in ZStack Cloud, you
can create an H3C SDN controller by adding the H3C_VDS_UUID option to
SystemTags. The SystemTag is passed by using the vdsUuid
parameter.
- Format of the H3C_VDS_UUID option:
vdsUuid::{%s} - Example:
vdsUuid::1234-5678 - Associated resource:
SdnControllerVO.class
- Format of the H3C_VDS_UUID option:
API Response
Sample
Response
{
"inventory": {
"uuid": "2f7e443a152833efb0f4b7d196a35ce0",
"vendorType": "H3C VCFC",
"name": "sdn-1",
"description": "sdn controller from vendor",
"ip": "192.168.1.1",
"username": "admin",
"password": "password"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SdnControllerInventory | See inventory. | 3.7.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| vendorType | String | 3.7.0 | |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| ip | String | 3.7.0 | |
| username | String | 3.7.0 | |
| password | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| vniRanges | List | See vniRanges. | 3.7.0 |
| vxlanPools | List | See vxlanPools. | 3.7.0 |
#vniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 |
#vxlanPools
| Name | Type | Description | Starting Version |
|---|---|---|---|
| sdnControllerUuid | String | 3.7.0 | |
| attachedCidrs | Map | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 | |
| attachedVtepRefs | List | See attachedVtepRefs. | 3.7.0 |
| attachedVxlanNetworkRefs | List | See attachedVxlanNetworkRefs. | 3.7.0 |
| attachedVniRanges | List | See attachedVniRanges. | 3.7.0 |
#attachedVtepRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| hostUuid | String | The host UUID. | 3.7.0 |
| vtepIp | String | 3.7.0 | |
| port | Integer | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| poolUuid | String | 3.7.0 |
#attachedVxlanNetworkRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vni | Integer | 3.7.0 | |
| poolUuid | String | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 |
#attachedVniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| l2NetworkUuid | String | The L2 network UUID. | 3.7.0 |
SDK Sample
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()QuerySdnController
API Request
URLs
GET zstack/v1/sdn-controllers
GET zstack/v1/sdn-controllers/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controllers?q=uuid=5e897e7e3a663786b873a3e020dbfc0acurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sdn-controllers/37c3e4f7602930c5888107528521ac90Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySdnController, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "b4134eb269a632eda5df826686733c5e",
"name": "test-sdn",
"description": "sdn for test",
"ip": "192.168.1.1",
"username": "admin",
"password": "password"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventories | List | See inventories. | 3.7.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| vendorType | String | 3.7.0 | |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| ip | String | 3.7.0 | |
| username | String | 3.7.0 | |
| password | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| vniRanges | List | See vniRanges. | 3.7.0 |
| vxlanPools | List | See vxlanPools. | 3.7.0 |
#vniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 |
#vxlanPools
| Name | Type | Description | Starting Version |
|---|---|---|---|
| sdnControllerUuid | String | 3.7.0 | |
| attachedCidrs | Map | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 | |
| attachedVtepRefs | List | See attachedVtepRefs. | 3.7.0 |
| attachedVxlanNetworkRefs | List | See attachedVxlanNetworkRefs. | 3.7.0 |
| attachedVniRanges | List | See attachedVniRanges. | 3.7.0 |
#attachedVtepRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| hostUuid | String | The host UUID. | 3.7.0 |
| vtepIp | String | 3.7.0 | |
| port | Integer | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| poolUuid | String | 3.7.0 |
#attachedVxlanNetworkRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vni | Integer | 3.7.0 | |
| poolUuid | String | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 |
#attachedVniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| l2NetworkUuid | String | The L2 network UUID. | 3.7.0 |
SDK Sample
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()RemoveSdnController
API Request
URLs
DELETE zstack/v1/sdn-controllers/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/sdn-controllers/237901c5097b38c480315569a1ac7567?deleteMode=PermissiveRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.7.0 | |
| deleteMode | String | body | Optional. The delete mode. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
When the API succeeded, an empty JSON structure {} is returned. When the API
failed, the returned JSON structure includes an error field. For
example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
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()UpdateSdnController
API Request
URLs
PUT zstack/v1/sdn-controllers/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"updateSdnController": {
"name": "Test-Net",
"description": "Test"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
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/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.7.0 | |
| name | String | body (contained in the updateSdnController structure) | Optional. The resource name. | 3.7.0 | |
| description | String | body (contained in the updateSdnController structure) | Optional. The detailed description of the resource. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
API Response
Sample
Response
{
"inventory": {
"uuid": "722428da8bac30d2b75daa2f6cd34e9d",
"vendorType": "H3C VCFC",
"name": "sdn-1",
"description": "sdn controller from vendor",
"ip": "192.168.1.1",
"username": "admin",
"password": "password"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.7.0 |
| inventory | SdnControllerInventory | See inventory. | 3.7.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.7.0 |
| description | String | The brief description of the error. | 3.7.0 |
| details | String | The details about the error. | 3.7.0 |
| elaboration | String | The reserved field. Default value: null. | 3.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.7.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| vendorType | String | 3.7.0 | |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| ip | String | 3.7.0 | |
| username | String | 3.7.0 | |
| password | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| vniRanges | List | See vniRanges. | 3.7.0 |
| vxlanPools | List | See vxlanPools. | 3.7.0 |
#vniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 |
#vxlanPools
| Name | Type | Description | Starting Version |
|---|---|---|---|
| sdnControllerUuid | String | 3.7.0 | |
| attachedCidrs | Map | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 | |
| attachedVtepRefs | List | See attachedVtepRefs. | 3.7.0 |
| attachedVxlanNetworkRefs | List | See attachedVxlanNetworkRefs. | 3.7.0 |
| attachedVniRanges | List | See attachedVniRanges. | 3.7.0 |
#attachedVtepRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| hostUuid | String | The host UUID. | 3.7.0 |
| vtepIp | String | 3.7.0 | |
| port | Integer | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| poolUuid | String | 3.7.0 |
#attachedVxlanNetworkRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vni | Integer | 3.7.0 | |
| poolUuid | String | 3.7.0 | |
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| zoneUuid | String | The zone UUID. | 3.7.0 |
| physicalInterface | String | 3.7.0 | |
| type | String | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| attachedClusterUuids | List | 3.7.0 |
#attachedVniRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.7.0 |
| name | String | The resource name. | 3.7.0 |
| description | String | The detailed description of the resource. | 3.7.0 |
| startVni | Integer | 3.7.0 | |
| endVni | Integer | 3.7.0 | |
| createDate | Timestamp | The creation date. | 3.7.0 |
| lastOpDate | Timestamp | The last operation date. | 3.7.0 |
| l2NetworkUuid | String | The L2 network UUID. | 3.7.0 |
SDK Sample
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()