Set Network Service Type on Bond Interface

POST/zstack/v1/hosts/bondings/service-types

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "bondingUuids": [
      "e96881d20cde3a9ab337cdf0ab4e8b08"
    ],
    "serviceTypes": [
      "TenantNetwork"
    ]
  },
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"bondingUuids":["e96881d20cde3a9ab337cdf0ab4e8b08"],"serviceTypes":["TenantNetwork"]}}' \
http://localhost:8080/zstack/v1/hosts/bondings/service-types

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

bondingUuids

List

body (contained in params structure)

Bond NIC UUIDs

 

4.7.11

vlanIds (optional)

List

body (contained in params structure)

VLAN interface IDs

 

4.7.11

serviceTypes (optional)

List

body (contained in params structure)

Network service type

  • ManagementNetwork
  • TenantNetwork
  • StorageNetwork
  • BackupNetwork
  • MigrationNetwork

4.7.11

systemTags (optional)

List

body

System tag

 

4.7.11

userTags (optional)

List

body

User tag

 

4.7.11

API Response

Response Example

{
  "inventory": [
    {
      "id": 0,
      "bondingUuid": "d1fd53a607c936859414f6222175c820",
      "vlanId": 10,
      "serviceType": "BackupNetwork"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.7.11
inventoryListSee details inventory4.7.11
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error4.7.11

inventory

NameTypeDescriptionStarting Version
bondingUuidStringBond NIC UUID4.7.11
vlanIdIntegerVLAN sub-interface ID4.7.11
createDateTimestampCreation time4.7.11
lastOpDateTimestampLast modification time4.7.11
serviceTypeHostNetworkInterfaceServiceTypeSee details serviceType4.7.11

serviceType

NameTypeDescriptionStarting Version
ManagementNetworkHostNetworkInterfaceServiceTypeManagement Network4.7.11
TenantNetworkHostNetworkInterfaceServiceTypeTenant Network4.7.11
StorageNetworkHostNetworkInterfaceServiceTypeStorage Network4.7.11
BackupNetworkHostNetworkInterfaceServiceTypeBackup Network4.7.11
MigrationNetworkHostNetworkInterfaceServiceTypeMigration Network4.7.11

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10014.7.11
descriptionStringBrief description of the error4.7.11
detailsStringDetailed error information4.7.11
elaborationStringReserved field, default is null4.7.11
opaqueLinkedHashMapReserved field, default is null4.7.11
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null4.7.11

SDK Examples

Java SDK

SetServiceTypeOnHostNetworkBondingAction action = new SetServiceTypeOnHostNetworkBondingAction();
action.bondingUuids = asList("e96881d20cde3a9ab337cdf0ab4e8b08");
action.serviceTypes = asList("TenantNetwork");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetServiceTypeOnHostNetworkBondingAction.Result res = action.call();

Python SDK

SetServiceTypeOnHostNetworkBondingAction action = SetServiceTypeOnHostNetworkBondingAction()
action.bondingUuids = [e96881d20cde3a9ab337cdf0ab4e8b08]
action.serviceTypes = [TenantNetwork]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetServiceTypeOnHostNetworkBondingAction.Result res = action.call()