This URL adds a vlan to the VLAN type specified interface. If a sub interface is given, the VLAN is assigned to the sub interface.
Resource URL
POST /sensor/<sensor_id>/interface/<interface_id or subinterface_id>/vlan
Request Parameters
URL Parameters:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| sensor_id | Sensor Id | Number | Yes |
| interface_id or subinterface_id | Unique interface/sub interface ID | Number | Yes |
Payload Parameters:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| VlanIds | VLAN IDs | Object | Yes |
Details of object in VlanIds:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| id | List of VLAN IDs | Array | Yes |
Response Parameters
Following fields are returned if the request parameters are correct, otherwise error details are returned.
| Field Name | Description | Data Type |
|---|---|---|
| Status | Status returned by deletion | Number |
Example
Request
POST https://%3CNSM_IP%3E/sdkapi/sensor/1001/interface/105/vlan
Payload
{
"VlanIds": {
"id": [
"17",
"18",
"19"
]
}
}
Response
{
"status":1
}
Error Information
Following error codes are returned by this URL:
| S.No | HTTP Error Code | SDK API errorId | SDK API errorMessage |
|---|---|---|---|
| 1 | 404 | 1106 | Invalid Sensor |
| 2 | 404 | 1107 | Invalid interface or sub-Interface id |
| 3 | 400 | 1158 | Non numeric VLAN id(s) provided |
| 4 | 400 | 1159 | Duplicate VLAN id(s) provided |
| 5 | 400 | 1161 | Out of range VLAN id(s) provided:[VLAN id list], VLAN id should be between 1 and 4094 |
| 6 | 400 | 1173 | Cannot add VLAN on dedicated/CIDR type interface |
| 7 | 400 | 1163 | Following VLAN id(s) is/are already added/assigned: |
| 8 | 400 | 1165 | No VLAN id is available for assignment in parent interface |
| 9 | 400 | 1166 | Following VLAN id(s) not present in parent interface for assignment on sub interface: |