SetServiceTypeOnHostNetworkBonding
API Request
URLs
POST zstack/v1/hosts/bondings/service-typesHeaders
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": {
"bondingUuids": [
"e96881d20cde3a9ab337cdf0ab4e8b08"
],
"serviceTypes": [
"TenantNetwork"
]
},
"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":{"bondingUuids":["e96881d20cde3a9ab337cdf0ab4e8b08"],"serviceTypes":["TenantNetwork"]}}' \
http://localhost:8080/zstack/v1/hosts/bondings/service-typesRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| bondingUuids | List | body (contained in the params structure) | The bond UUID list. | 4.7.11 | |
| vlanIds | List | body (contained in the params structure) | Optional. The VLAN interface id list. | 4.7.11 | |
| serviceTypes | List | body (contained in the params structure) | Optional. The network type. |
|
4.7.11 |
| systemTags | List | body | Optional. The system tags. | 4.7.11 | |
| userTags | List | body | Optional. The user tags. | 4.7.11 |
API Response
Sample
Response
{
"inventory": [
{
"id": 0,
"bondingUuid": "d1fd53a607c936859414f6222175c820",
"vlanId": 10,
"serviceType": "BackupNetwork"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.7.11 | |
| inventory | List | See inventory. | 4.7.11 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.7.11 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| bondingUuid | String | The bond UUID. | 4.7.11 |
| vlanId | Integer | The VLAN interface ID. | 4.7.11 |
| createDate | Timestamp | The creation date. | 4.7.11 |
| lastOpDate | Timestamp | The last operation date. | 4.7.11 |
| serviceType | HostNetworkInterfaceServiceType | See serviceType. | 4.7.11 |
#serviceType
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ManagementNetwork | HostNetworkInterfaceServiceType | The management network. | 4.7.11 |
| TenantNetwork | HostNetworkInterfaceServiceType | The business network. | 4.7.11 |
| StorageNetwork | HostNetworkInterfaceServiceType | The storage network. | 4.7.11 |
| BackupNetwork | HostNetworkInterfaceServiceType | The backup network. | 4.7.11 |
| MigrationNetwork | HostNetworkInterfaceServiceType | The migration network. | 4.7.11 |
#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. | 4.7.11 |
| description | String | The brief description of the error. | 4.7.11 |
| details | String | The details about the error. | 4.7.11 |
| elaboration | String | The reserved field. Default value: null. | 4.7.11 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.11 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.7.11 |
SDK Sample
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()