Set Network Service Type on Physical Interface
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"interfaceUuids": [
"2894f52c7d84366c85dd115b3bc193ca"
]
},
"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":{"interfaceUuids":["2894f52c7d84366c85dd115b3bc193ca"]}}' \
http://localhost:8080/zstack/v1/hosts/nics/service-typesParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
interfaceUuids | List | body (contained in params structure) | Physical 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 |
| 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,
"interfaceUuid": "8534263f624a3962b7603c99a3e44eb2",
"vlanId": 10,
"serviceType": "BackupNetwork"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.7.11 | |
| inventory | List | See details inventory | 4.7.11 |
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. See details error | 4.7.11 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| interfaceUuid | String | Physical NIC UUID | 4.7.11 |
| vlanId | Integer | VLAN sub-interface ID | 4.7.11 |
| createDate | Timestamp | Creation time | 4.7.11 |
| lastOpDate | Timestamp | Last modification time | 4.7.11 |
| serviceType | HostNetworkInterfaceServiceType | See details serviceType | 4.7.11 |
serviceType
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ManagementNetwork | HostNetworkInterfaceServiceType | Management Network | 4.7.11 |
| TenantNetwork | HostNetworkInterfaceServiceType | Tenant Network | 4.7.11 |
| StorageNetwork | HostNetworkInterfaceServiceType | Storage Network | 4.7.11 |
| BackupNetwork | HostNetworkInterfaceServiceType | Backup Network | 4.7.11 |
| MigrationNetwork | HostNetworkInterfaceServiceType | Migration Network | 4.7.11 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 4.7.11 |
| description | String | Brief description of the error | 4.7.11 |
| details | String | Detailed error information | 4.7.11 |
| elaboration | String | Reserved field, default is null | 4.7.11 |
| opaque | LinkedHashMap | Reserved field, default is null | 4.7.11 |
| cause | ErrorCode | Root cause, the error that caused the current error. If there is no original error, this field is null | 4.7.11 |
SDK Examples
Java SDK
SetServiceTypeOnHostNetworkInterfaceAction action = new SetServiceTypeOnHostNetworkInterfaceAction();
action.interfaceUuids = asList("2894f52c7d84366c85dd115b3bc193ca");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetServiceTypeOnHostNetworkInterfaceAction.Result res = action.call();Python SDK
SetServiceTypeOnHostNetworkInterfaceAction action = SetServiceTypeOnHostNetworkInterfaceAction()
action.interfaceUuids = [2894f52c7d84366c85dd115b3bc193ca]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetServiceTypeOnHostNetworkInterfaceAction.Result res = action.call()