-
Notifications
You must be signed in to change notification settings - Fork 67
API Changes
Due to a bug in the github page rendering you can find this page in PDF format here.
We are transitioning the API to JSON from XMLRPC. The API syntax may change in some areas and therefore this document is intended to details these changes. These changes will be introduced as of FlowVisor 1.0.
The XMLRPC API will remain as is but in a deprecated state, eventually it will be removed. So FlowVisor users are advised to transition any of their dependencies on the API to the JSON interface.
We are introducing two APIs with the JSON RPC API. The first will be used to configure the FlowVisor while the other one will be used to obtain monitoring information.
The API will be implemented according to the JSON RPC 2.0 Spec found at http://www.jsonrpc.org/specification
Each request will be make with the following wire protocol:
{ "id":<string>, "method":<method-name>, "params":<input>, "jsonrpc":"2.0" }
The params field is specified in the input column of the tables below.
Each reply will be make with the following wire protocol:
{ "id":<string>, "result":<output>, "error": { "code" : <error-code>, "msg" : <msg>, "data" : <data> }, "jsonrpc":"2.0" }
The error field will only be present in case of an error. The result field will only be present in case of success. The result field is specified in the output column of the below tables.
code | message | meaning |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. |
-32600 | Invalid Request | The JSON sent is not a valid Request object. |
-32601 | Method not found | The method does not exist / is not available. |
-32602 | Invalid params | Invalid method parameter(s). |
-32603 | Internal error | Internal JSON-RPC error. |
Command Name | Input | Output |
---|---|---|
[POST]
|
{ "slice-name" : <name>, "controller-url" : <pseudo-url>, "admin-contact" : <email>, "password" : <password>, "drop-policy" : "exact|rule", OPTIONAL DEFAULT "exact" "recv-lldp" : <boolean>, OPTIONAL DEFAULT false "flowmod-limit" : <number>, OPTIONAL DEFAULT -1 "rate-limit" : <number>, OPTIONAL DEFAULT -1 "admin-status" : <boolean> OPTIONAL DEFAULT true } |
<boolean> |
[POST]
|
None |
[ { "slice-name" : <name>, "admin-status" <boolean> } ] |
[POST]
|
{ "slice-name" : <name>, "controller-host" : <hostname>, OPTIONAL "controller-port" : <port-number>, OPTIONAL "admin-contact" : <email>, "drop-policy" : "exact|rule", OPTIONAL "recv-lldp" : <boolean>, OPTIONAL "flowmod-limit" : <number>, OPTIONAL "rate-limit" : <number>, OPTIONAL "admin-status" : <boolean> OPTIONAL } |
<boolean> |
[POST]
|
{ "slice-name" : <name> } |
<boolean> |
[POST]
|
{ "slice-name" : <name>, "password" : <password> } |
<boolean> |
[POST]
|
{ "slice-name" : <name> OPTIONAL "show-disabled" : <boolean> OPTIONAL } |
[ <flowspace-entries> ] |
[POST]
|
[ <flowspace-name> ] |
<boolean> |
[POST]
|
[ { "name" : <string>, "dpid" : <dpid>, "priority" : <number>, "match" : <match-struct>, "queues" : [ <queue_id> ], OPTIONAL "force-enqueue" : <queue_id>, OPTIONAL "slice-action" : [ { "slice-name" : <name> ", "permission" : <perm-value> } ] } ] |
<Integer - index Id> |
[POST]
|
[ { "name" : <string> "dpid" : <dpid>, OPTIONAL "priority" : <number>, OPTIONAL "match" : <match-struct>, OPTIONAL "queues" : [ <queue_id> ], OPTIONAL "force-enqueue" : <queue_id>, OPTIONAL "slice-action" : [ { "slice-name" : <name> ", "permission" : <perm-value> } OPTIONAL ] } ] |
<Integer - index Id> |
[POST]
|
{ "fs-id" : <flowspace-request-id> } |
# SUCCESS = Great! # PENDING = In process # UNKNOWN = Unknown id # err_msg = an error msg <string> |
[POST]
|
None |
{ "flowvisor-version" : <version>, "db-version" : <version> } |
[POST]
|
# Default values here represent # values at FV initialisation # and not the default values # if parameters are omitted. # -1 == no limit { "flood-perm" : { "slice-name" : <name>, "dpid" : <dpid> OPTIONAL }, OPTIONAL DEFAULT NONE "flowmod-limit" : { "slice-name" : <name>, "dpid" : <dpid>, "limit" : <number> }, OPTIONAL DEFAULT -1 "track-flows" : <boolean>, OPTIONAL DEFAULT false "stats-desc" : <boolean>, OPTIONAL DEFAULT false "enable-topo-ctrl" : <boolean>, OPTIONAL DEFAULT false "flow-stats-cache" : <number> OPTIONAL DEFAULT 30 (seconds) } |
<boolean> |
[POST]
|
{ "slice-name" : <name>, OPTIONAL "dpid" : <dpid>, OPTIONAL } |
# if slice and/or dpid # specified then results # will only include this # slice or dpid, if applicable. { "flood-perm" : [ { "slice-name" : <name>, "dpid" : <dpid> } ], "flowmod-limit" : { <slice-name> : { <dpid> : <limit> } } , "track-flows" : <boolean>, "stats-desc" : <boolean>, "enable-topo-ctrl" : <boolean>, "flow-stats-cache" : <number>, } |
[POST]
|
None |
# returns the config as a # single text blob <text> |
Command Name | Input | Output |
---|---|---|
[POST]
|
{ "slice-name" : <name> } |
# msg field to be used # for ad-hoc communication { "slice-name" : <name>, "controller-url" : <pseudo-url>, "admin-contact" : <email>, "drop-policy" : "exact|rule", "recv-lldp" : <boolean>, "current-rate" : "msgs-per-sec", "current-flowmod-usage" : <number>, "msg" : <string> } |
[POST]
|
None |
[ <dpid> ] |
[POST]
|
None |
[ { "srcDpid" : <dpid>, "srcPort" : <port-no>, "dstDpid" : <dpid>, "dstPort" : <port-no> } ] |
[POST]
|
{ "dpid" : <dpid> } |
{ "dpid" : <dpid>, "num-ports" : <number>, "port-list" : [ <port-no> ], "port-names" : [ <port-names> ], "connection" : <connection-id>, "current-flowmod-usage" : { <slicename> : <limit>, <slicename> : <limit>, . . . <slicename> : <limit> } } |
[POST]
|
{ "slice-name" : <name> } |
#There may be may sender-names, hence #the map { "tx" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } }, "rx" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } }, "drop" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } } } |
[POST]
|
{ "dpid" : <dpid> } |
#There may be may sender-names, hence #the map { "tx" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } }, "rx" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } }, "drop" : { <sender-name> : { <msg-type-name> : <value>, <msg-type-name> : <value>, . . . <msg-type-name> : <value> } } } |
[POST]
|
None |
{ "average-delay" : <millisec-delay>, "instant-delay" : <millisec-delay>, "active-db-sessions" : <number>, "idle-db-sessions" : <number> } |
[POST]
|
{ "slice-name" : <name> } |
{ "is-connected" : <boolean>, "connect-drop-count" : <number>, "fs-entries" : <number>, "connected-dpids" : [ <dpid> ] } |
[POST]
|
# event-type is: # DEVICE_CONNECTED # SLICE_CONNECTED # SLICE_DISCONNECTED { "url" : <url>, "method" : <method_name>, "event-type" : <ev_type>, "name" : <string> } # event-type is: # FLOWTABLE_CALLBACK # Eg. ./fvctl.py register-event-callback http://127.0.0.1:8000 # foo FLOWTABLE_CALLBACK alice -d 3 # dpid is optional, if not specified with the -d option, # the api will consider it as all dpids. { "url" : <url>, "method" : <method_name>, "event-type" : <ev_type>, "name" : <string> "dpid" : <dpid> } |
# event-type is: # DEVICE_CONNECTED # SLICE_CONNECTED # SLICE_DISCONNECTED <boolean> # event-type is: # FLOWTABLE_CALLBACK # Body of reply to OFPST_FLOW request. struct ofp_flow_stats { length; <int> table_id; <int> #Match struct ofp_match match; <map of maps> duration_sec; <int> duration_nsec; <int> priority; <int> idle_timeout; <int> hard_timeout; <int> cookie; <int> packet_count; <int> byte_count; <int> # Actions struct ofp_action_header actions; <map with a list which contains maps of a map> }; |
[POST]
|
# event-type is: # DEVICE_CONNECTED # SLICE_CONNECTED # SLICE_DISCONNECTED { "method" : <method_name>, "event-type" : <ev_type>, "name" : <string> } # event-type is: # FLOWTABLE_CALLBACK # Eg. ./fvctl.py unregister-event-callback http://127.0.0.1:8000 # foo FLOWTABLE_CALLBACK alice -d 3 # dpid is optional, if not specified with the -d option, # the api will consider it as all dpids. { "url" : <url>, "method" : <method_name>, "event-type" : <ev_type>, "name" : <string> "dpid" : <dpid> } |
<boolean> |
- System Requirements
- XML-RPC Deprecated
- Installation
- FlowVisor FAQ
- CLI User Guide
- Papers
-
Development
- Design Documents
-
Architecture
- IO Overview
- Actions
- Messages
- Configuration Parameters
- Processes
- RoadMap