Skip to content

Commit

Permalink
Update the documentation of the NApp
Browse files Browse the repository at this point in the history
Fix #22
  • Loading branch information
renanrodrigo committed Oct 17, 2017
1 parent 3b41fee commit dc4b33c
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 7 deletions.
79 changes: 78 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,41 @@ This application creates an abstraction layer to other applications:
it is only necessary to know the endpoints. The application handles
the requests and return the information already formatted.

Supported Fields
================

This NApp support a subset of the OpenFlow specification fields in the bodies of
the requests when creating and removing flows:

- Flow attributes:

- priority: Priority of the flow entry when matching packets;
- idle_timeout: Time before the flow expires when no packet is matched;
- hard_timeout: Time before the flow expires, not related to matching;
- cookie: Flow cookie;
- match:

- in_port: Port where the packet came from;
- dl_src: Ethernet frame source MAC address;
- dl_dst: Ethernet frame destination MAC address;
- dl_type: EtherType of the upper layer protocol;
- dl_vlan: 802.1q VLAN ID;
- dl_vlan_pcp: 802.1q VLAN PCP;
- nw_src: IPv4 source address of the packet;
- nw_dst: IPv4 destination address of the packet;
- nw_proto: Upper layer protocol number;

- actions:

- set_vlan: Change the VLAN ID of the packet;
- output: Send the packet through a port (physical port or controller).

.. note::

For OpenFlow 1.3, the only Instruction supported is InstructionApplyAction.

Other fields are not supported and will generate error messages from the NApp.

##########
Installing
##########
Expand All @@ -27,9 +62,51 @@ To install this NApp, run:
$ kytos napps install kytos/flow_manager
########
Rest API
========
########

You can find a list of the available endpoints and example input/output in the
'REST API' tab in this NApp's webpage in the `Kytos NApps Server
<https://napps.kytos.io/kytos/flow_manager>`_.

######
Events
######

Generated
*********

kytos/flow_manager.add_flow
===========================

*buffer*: ``app``

Event reporting that a FlowMod was sent to a Datapath with the ADD command.

Content
-------

.. code-block:: python3
{
'datapath': <Switch object>,
'flow': <Object representing the installed flow>
}
kytos/flow_manager.remove_flow
==============================

*buffer*: ``app``

Event reporting that a FlowMod was sent to a Datapath with the DELETE command.

Content
-------

.. code-block:: python3
{
'datapath': <Switch object>,
'flow': <Object representing the removed flow>
}
36 changes: 30 additions & 6 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ paths:
consumes:
- application/json
responses:
'201':
'202':
description: FlowMod messages sent.
'400':
description: Invalid JSON flow.
'/api/kytos/flow_manager/flows/{dpid}':
get:
tags:
Expand All @@ -62,6 +64,8 @@ paths:
application/json:
schema:
$ref: '#/definitions/ResponseExample'
'404':
description: Datapath not found.
post:
tags:
- Add
Expand All @@ -83,17 +87,21 @@ paths:
consumes:
- application/json
responses:
'201':
'202':
description: FlowMod messages sent.
'400':
description: Invalid JSON flow.
'404':
description: Datapath not found.
/api/kytos/flow_manager/delete:
post:
tags:
- Delete
summary: Remove flows from all known datapaths.
summary: Remove matching flows from all known datapaths.
parameters:
- in: body
name: body
description: List of flows to be removed.
description: Parameters of flows to be removed. The NApp will send a FlowMod message requesting the removal of flows with those parameters.
required: true
schema:
type: array
Expand All @@ -104,15 +112,17 @@ paths:
responses:
'202':
description: FlowMod messages sent.
'400':
description: Invalid JSON flow.
'/api/kytos/flow_manager/delete/{dpid}':
post:
tags:
- Delete
summary: Remove flows from a single datapath.
summary: Remove matching flows from a single datapath.
parameters:
- in: body
name: body
description: List of flows to be removed.
description: Parameters of flows to be removed. The NApp will send a FlowMod message requesting the removal of flows with those parameters.
required: true
schema:
type: array
Expand All @@ -128,6 +138,10 @@ paths:
responses:
'202':
description: FlowMod messages sent.
'400':
description: Invalid JSON flow.
'404':
description: Datapath not found.
definitions:
MatchExample:
type: object
Expand Down Expand Up @@ -232,3 +246,13 @@ definitions:
type: integer
format: int64
example: 84114904
priority:
type: integer
format: int64
example: 10
match:
type: object
properties:
dl_src:
type: string
example: '00:0a:0b:c2:12:16'

0 comments on commit dc4b33c

Please sign in to comment.