Inter-IoT_network API Reference
Network Controller API
API Endpoint
http://192.168.1.8:8080/
Request Content-Types: application/json, application/x-www-form-urlencoded
Response Content-Types: application/json
Schemes: http
Version: 1.0.0
Switches
List Switches
Retrieve the list of all switches within the virtual network.
Switches ID list
Switch Basic Description
Retrieve basic information of the sought switch.
Switch ID
Switch Info
Invalid ID
Flows
Flow information
Retrieve info about a specific flow in the switch.
Switch ID
Flow information
Addition of a new flow entry
Flow entry description
(no description)
Request Example
{
"dpid": 1,
"cookie": 1,
"cookie_mask": 1,
"table_id": 0,
"idle_timeout": 30,
"hard_timeout": 30,
"priority": 1111,
"buffer_id": 1,
"flags": 1,
"match": {
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
},
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
OK
Invalid input
Modify flow entry in a switch
Flow entry description
Request Example
{
"dpid": 1,
"cookie": 1,
"cookie_mask": 1,
"table_id": 0,
"idle_timeout": 30,
"hard_timeout": 30,
"priority": 1111,
"buffer_id": 1,
"flags": 1,
"match": {
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
},
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
OK
Invalid input
POST /stats/flowentry/delete
Delete flow entry in a switch
Flow entry deletion
Request Example
{
"dpid": 1,
"cookie": 1,
"cookie_mask": 1,
"table_id": 0,
"idle_timeout": 30,
"hard_timeout": 30,
"priority": 1111,
"buffer_id": 1,
"flags": 1,
"match": {
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
},
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
OK
Invalid input
Tables
Table information
Retrieve info about a specific table in the switch.
Switch ID
Table information
Table features information
Retrieve info about features of a specific table in the switch.
Switch ID
Table features information
Ports
Port information
Retrieve info about a specific port in a switch.
Switch ID
Port information
Port information
Retrieve info about a specific port in a switch.
Switch ID
Port ID
All Ports information
Modify port description
Port description
Request Example
{
"dpid": 1,
"port_no": 1,
"config": 1,
"mask": 1
}
OK
Invalid input
Roles
Set a role
Role
OK
Invalid input
Queues
Get status of the queue
Switch ID
Retrieve the queue configuration
Queue description
Set a queue into a port
Flow information. If OFv1.3 or earlier: 'actions', if OFv1.4 or later: 'instrucions'
Switch ID
Request Example
{
"dpid": 1,
"cookie": 1,
"cookie_mask": 1,
"table_id": 0,
"idle_timeout": 30,
"hard_timeout": 30,
"priority": 1111,
"buffer_id": 1,
"flags": 1,
"match": {
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
},
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
Flow Info
Invalid ID
Not found
Invalid Input
Delete the configuration of a queue
(no description)
OK
Rules
Retrieve the rules configuration
Rule Configuration
POST /qos/rule/{id}
undefined
(no description)
Request Example
{
"priority": "integer",
"match": [
{
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
}
],
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
OK. Qos ID generated
Response Example (200 OK)
"integer"
Delete a Qos Rule
Switch ID
integer || all
OK
Meters
Retrieve the meters configuration
Meter Configuration
POST /qos/meter/{id}
Meter
switch ID
Request Example
{
"meter_id": "integer",
"bands": {
"action": "string",
"flag": "string",
"burst_size": "integer",
"rate": "integer",
"prec_level": "integer"
}
}
OK
Delete a Qos Meter
Switch ID
Meter ID
OK
Schema Definitions
portdesc: object
- dpid: integer
- port_no: integer 0
- config: integer 0
- mask: integer 0
Example
{
"dpid": 1,
"port_no": 1,
"config": 1,
"mask": 1
}
flowentry: object
Example
{
"dpid": 1,
"cookie": 1,
"cookie_mask": 1,
"table_id": 0,
"idle_timeout": 30,
"hard_timeout": 30,
"priority": 1111,
"buffer_id": 1,
"flags": 1,
"match": {
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
},
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
queue: object
- port_name: string OFPP_ANY
-
Name of the port
- type: string linux-htb, linux-other
-
linux-htb or linux-other
- max_rate: integer
-
Bandwith max rate of the queue in bps
- queues: object
-
- max_rate: integer
-
Maximum rate of the queue
- min_rate: integer
-
Minimum rate of the queue
Example
{
"port_name": "eth1",
"type": "string",
"max_rate": "integer",
"queues": {
"max_rate": "integer",
"min_rate": "integer"
}
}
rule: object
Example
{
"priority": "integer",
"match": [
{
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
}
],
"actions": [
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
]
}
match: object
- in_port: integer 0 ≤ x ≤ 65535
- dl_src: string
- dl_dst: string
- dl_type: string ARP, IPv4, IPv6
-
- nw_src: string
-
<A.B.C.D/M>
- nw_dst: string
-
<A.B.C.D/M>
- ipv6_src: string
- ipv6_dst: string
- nw_proto: string TCP, UDP, IPCM, IPCMv6
-
- tp_src: integer 0 ≤ x ≤ 65535
-
- tp_dst: integer 0 ≤ x ≤ 65535
-
- ip_dscp: integer 0 ≤ x ≤ 63
-
Example
{
"in_port": "integer",
"dl_src": "string",
"dl_dst": "string",
"dl_type": "string",
"nw_src": "string",
"nw_dst": "string",
"ipv6_src": "string",
"ipv6_dst": "string",
"nw_proto": "string",
"tp_src": "integer",
"tp_dst": "integer",
"ip_dscp": "integer"
}
action: array
- mark: integer 0 ≤ x ≤ 63
-
, sets the IPv4 ToS/DSCP field to tos. - meter: integer
-
meter ID, apply meter entry
- queue: integer
-
queue ID, register queue specified by queue-id
Example
[
{
"mark": "integer",
"meter": "integer",
"queue": "integer"
}
]
meter: object
Meters declaration. The parameters specified in the bands depend on the flag type.
- meter_id: integer
- bands: object
-
- action: string DROP, DSCP_REMARK
- flag: string KBPS, PKTPS, BURST, STATS
- burst_size: integer
- rate: integer
- prec_level: integer
-
Number of drop precedence level to add
Example
{
"meter_id": "integer",
"bands": {
"action": "string",
"flag": "string",
"burst_size": "integer",
"rate": "integer",
"prec_level": "integer"
}
}