We use proprietary and third party's cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
NetIC Restful API Specification - FIWARE Forge Wiki

NetIC Restful API Specification

From FIWARE Forge Wiki

Jump to: navigation, search

Contents

Introduction to the NetIC_Restful_API_1 API

Legal Notice

Please check the following Legal Notice to understand the rights to use these specifications.

NetIC_Restful_API_1 API Core

The NetIC_Restful_API_1 API is intended to access network status information and to allow a pre-defined level of programmability within the network. This programmability may also enable network virtualization, i. e., the abstraction of the physical network resources as well as their control by a virtual network provider. This is a RESTful, resource-oriented API accessed via HTTP that uses JSON-based representations for information interchange.

It should be noted that the exposition of specific capabilities via the northbound interface depends on the capabilities and the technology of the underlying network. Users of the API will be able to explore the functionalities, by navigating this API in a RESTful fashion.

Intended Audience

This specification is intended for software developers, network operators and reimplementers.

  • For the software developpers and reimplementers, this document provides a full specification of how to interoperate with networks that implement this API.
  • For the network operators, this specification indicates the interface to be provided in order to allow applications and (virtual) network service providers to access the described functionalities.

API Change History

This version of the API Guide replaces and obsoletes all previous versions. The most recent changes are described in the table below:

Revision Date Changes Summary
January, 2013 Initial version
March, 2013 Uniroma Contribution
January, 2014 Uniroma Contribution
April, 2014 Uniroma Contribution

How to Read This Document

It is assumed that the reader is familiar with the REST architecture style. Within the document, some special notations are applied to differentiate some special words or concepts. The following list summarizes these special notations.

  • A bold, mono-spaced font is used to represent code or logical entities, e.g., HTTP method (GET, PUT, POST, DELETE).
  • An italic font is used to represent document titles or some other kind of special text, e.g., URI.
  • Variables are represented between brackets, e.g. {id} and in italic font. The reader can replace the id with an appropriate value.

Additional Resources

You can download the most current version of this document from the FIWARE API specification website at <link to the url>. For more details about the NetIC GE that this API is based upon, please refer to FIWARE.I2ND.NetIC Open Specification.

General NetIC_Restful_API_1 API Information

Resources Summary

This API exposes a set of commands on the NetIC GE that enables information retrieval from and some level of control of the underlying network. This is done through manipulating different objects, like:

  • Network
  • Node
  • Port
  • Link
  • Path/VirtualPath
  • Monitoring task

The picture below gives an overview of the different URI that can be used in the API.

Authentication

Each HTTP request against the NetIC RESTful API requires the inclusion of specific authentication credentials. The specific implementation of this API may support multiple authentication schemes (OAuth, Basic Auth, Token) and will be determined by the specific provider that implements the GE. Please contact with it to determine the best way to authenticate against this API. Remember that some authentication schemes may require that the API operate using SSL over HTTP (HTTPS).

Representation Format

NetIC Restful API supports at least JSON for delivering any kind of resources, it may also support XML, simple text, and HTML output format. The request format is specified using the Content-Type header and is required for operations that have a request body. The response format can be specified in requests using the Accept header. Note that it is possible for a response to be serialized using a format different from the request (see example below).

If no Content-Type is specified, the content is delivered in the format that was choosen to upload the resource.

The interfaces should support data exchange through multiple formats:

  • text/plain - A linefeed separated list of elements for easy mashup and scripting.
  • text/html - An human-readable HTML rendering, of the results of the operation as output format.
  • application/json - A JSON representation of the input and output for mashups or JavaScript-based Web Apps
  • application/xml - A XML description of the input and output.

Representation Transport

The resource representation is transmitted between client and server by using HTTP protocol. Each message is based on HTTP/1.1 requests. The header of each message contains a specified user-agent, a specified host, a content-type header set as “application/json” and various other header fields as the ones reported in the example below.

GET /netic.v1/doc HTTP/1.1
'origin': 'http://localhost',
'accept-language': 'en-US,en;q=0.8',
'accept-encoding': 'gzip,deflate,sdch',
'host': 'localhost:2222',
'accept': 'application/json, text/javascript, */*; q=0.01',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',
'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'connection': 'keep-alive',
'content-type': 'application/json'
'referer': 'http://localhost/'

Resource Identification

The resource identification used by this API is based on the URI scheme described by HTTP protocol specification as defined by IETF RFC-2616 ( https://www.ietf.org/rfc/rfc2616.txt )

Paginated Collections (Optional)

In order to reduce the load on the service, we can decide to limit the number of elements to return when it is too big. This section explain how to do that using for example a limit parameter (optional) and a last parameter (optional) to express which is the maximum number of element to return and which was the last element to see.

For everyone's convenience, it would be useful that the information returned would have a atom "next" links with the information for the next data. Optional we could have a atom "previous" link to return to the previous values.

These operations will have to cope with the possibility to have over limit fault (413) or item not found fault (404).

Efficient Polling with the Changes-Since Parameter (Optional)

In this case we can specify the parameter changes-since in a GET method in order that the response will give us only the changed information from the previous request specified through a dateTime format ISO 8601 (2011-01-24T17:08Z).

Limits

We can manage the capacity of the system in order to prevent the abuse of the system through some limitations. These limitations will be configured by the operator and may differ from one implementation to other of the GE implementation.

Rate Limits

These limits are specified both in human readable wild-card and in regular expressions and will indicate for each HTTP verb which will be the maximum number of operations per time unit that a user can request. After each unit time the counter is initialized again. In the event a request exceeds the thresholds established for your account, a 413 HTTP response will be returned with a Retry-After header specifying the instant of time, in format ISO 8601, after which the client can attempt to try again.

See OpenStack Compute API for more details.


Response status code 413 : Request entity too large
************** Response: ***************
{"displayError": "The server can not perform this operation.", 
 "error": "User and/or total limis exceeded", 
 "limits": {
     "remaining_PUT": 2, 
     "remaining_DEL": 2, 
     "remaining_GET": 0, 
     "remaining_POST": 2, 
     retryAfter": "2013-04-19T13:40:19Z+0000"
     }
 }

Absolute Limits

In this case, absolute values are specified, e.g. maximum total amount of RAM (MB), always within a deployment. See OpenStack Compute API for more details.

Determining Limits Programmatically

We can use GET verb with the /limits URI in order to obtain all this information.

VerbURIDescription
GET /limitsReturns the current limits for your account

This operation must return Normal response code(s), e.g. 200 or 203 and will have to manage some possible errors like compute fault, service unavailable, unauthorized operation, forbidden, bad request, bad method or operation over limit.

This operation will not need a request body but we have to specify the response body in the appropriate representation information format (XML and/or JSON). See OpenStack Compute API for more details.

Versions

The version of the NetIC API is embedded in the server root path e.g.

https://localhost/netic.v1/doc

Extensions

In this section we should indicate which are the extensions that we could use in the API in order to allow the extensibility of our API. This allows the introduction of new features in the API without requiring an update of the version and also allows the introduction of vendor specific functionality. Applications could recover this information through the following request. Note that this is a versioned request — that is, an extension available in one API version may not be available in another.

VerbURIDescription
GET /extensionsList of all available extensions

Normal Response Code(s): 200, 203

Error Response Code(s): computeFault (400, 500, …), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413)

This operation does not require a request body. Each extension is identified by two unique identifiers, a namespace and an alias. Additionally an extension contains documentation links in various formats.

Extensions Response: JSON

{
    "extensions":[
        {
            "name" : "FIWARE Extension",
            "namespace" : "https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/NetIC_RESTful_API_Specification",
            "alias" : "Uniroma1",
            "updated" : "2013-03-04T10:45:03+01:00",
            "description" : "Adds the capability to create Monitoring Tasks in the network"
        }

    ]
}


Extensions may also be queried individually by their unique alias. This provides the simplest method of checking if an extension is available as an unavailable extension will issue an itemNotFound (404) response.

VerbURIDescription
GET /extensions/{alias}Get details about a specific extension

Normal Response Code(s): 200, 203


Error Response Code(s): computeFault (400, 500, …), serviceUnavailable (503), unauthorized (401), forbidden (403), badRequest (400), badMethod (405), overLimit (413), itemNotFound (404)

And the response in JSON would be the following

{
    "extension" : {
        "name" : "FIWARE Extension",
        "namespace" : "https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/NetIC_RESTful_API_Specification",
        "alias" : "Uniroma1",
        "updated" : "2013-03-04T10:45:03+01:00",
        "description" : "Adds the capability to create Monitoring Tasks in the network"
    }
}

Faults

For the set of faults that NetIC API can return, see Synchronous Faults and Asynchronous Faults in OpenStack Compute API specification.

API Operations

In this section we go in depth for each operation. The API operations are divided into three groups of functionalities: {Synchronize, Monitor, Virtualpaths}. The next subsections will provide an insight of all the possible commands of each group.

Synchronize

Synchronize commands allow the users of the NetIC API to retrieve information about network topology, node configuration, port status, etc.

List network

Verb URI Description
GET /netic.v1/OFNIC/synchronize/network Get list of nodes and virtual paths.

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

https://localhost:2222/netic.v1/OFNIC/synchronize/network
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "Paths": [], 
        "Nodes": [
            1, 
            2, 
            3
        ]
    }
}

List node

Verb URI Description
GET /netic.v1/OFNIC/synchronize/network/node/{node_ID} Retrieve all available information about the node with id: node_id

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

https://localhost:2222/netic.v1/OFNIC/synchronize/network/node/1
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "Port_Names": [
            "eth2", 
            "br0", 
            "eth1"
        ], 
        "Port_Index": [
            2, 
            65534, 
            1
        ], 
        "Num_Buffers": 256, 
        "Actions": 4095, 
        "Num_Tables": 255
    }
}

List port

Verb URI Description
GET /netic.v1/OFNIC/synchronize/network/node/{nID}/port/{pID} Retrieve all available information about the port with id: nID located in the node with id: pID

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.


Example

https://localhost:2222/netic.v1/OFNIC/synchronize/network/node/1/port/2
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "Active": true,
        "Config": 0, 
        "State": 0, 
        "Speed": 0, 
        "links": [
            0
        ]
    }
}

List link

Verb URI Description
GET /netic.v1/OFNIC/synchronize/network/node/{nID}/port/{pID}/link/{lID} Retrieve the peer node and port connected to link with id: lID


Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)


This operation does not require a request body.

Example

https://localhost:2222/netic.v1/OFNIC/synchronize/network/node/1/port/1/link/0
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "node": 2, 
        "port": 1
    }
}

Virtualpath

Available in FIWARE Release 2.3

List all virtualpaths

Verb URI Description
GET /netic.v1/OFNIC/virtualpath List all created virtual paths in the network.

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

GET https://127.0.0.1:2222/netic.v1/OFNIC/virtualpath
Response status code 200 : OK
************** Response: ***************
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "Paths": [
            "7a8b",
            "dc6b"
        ]
    }
}

Create

Verb URI Description
POST /netic.v1/OFNIC/virtualpath/create Create a new virtual path in the network.


Parameter Meaning Importance Notes
nw_src IP address of the source
of the flow
Mandatory parameter Dotted notation, e.g. 192.168.1.1
nw_dst IP address of the destination
of the flow
Mandatory parameter Dotted notation, e.g. 192.168.1.2
duration Duration of the virtual path Mandatory parameter Unit in seconds
bandwidth Required bandwidth of
the virtual path
Mandatory parameter Unit is in kbps
set_arp Set to 1 or 0 if arp path is
to be set or not respectively
Mandatory parameter
bidirectional Set to 1 or 0 if the reverse virtual
path is needed or not, respectively
Mandatory parameter
dp_src Source node ID Mandatory if hosts don't announce
their link layer info with LLDP
Unsigned int of 64 bits
dp_dst Destination node ID Mandatory if hosts don't announce
their link layer info with LLDP
Unsigned int of 64 bits
first_port Port id in the source node Mandatory if hosts don't announce
their link layer info with LLDP
Unsigned int of 16 bits
last_port Port id in the destination node Mandatory if hosts don't announce
their link layer info with LLDP
Unsigned int of 16 bits
dl_src Mac address of the Host
that generates the flow
Optional if the LLDP is not announced
and the user wants to set the arp path
Colon separated notation
e.g. a6:8a:d7:63:1e:49
dl_dst Mac address of the Host
that receives the flow
Optional if the LLDP is not announced
and the user wants to set the arp path
Colon separated notation
e.g. a6:8a:d7:63:1e:49
transport_type Type of transport protocol Optional UDP or TCP
tp_src Transport protocol source port Optional Unsigned int of 16 bit
tp_dst Transport protocol destination port optional Unsigned int of 16 bit

Example

POST https://127.0.0.1:2222/netic.v1/OFNIC/virtualpath/create
nw_src = 192.168.10.2
nw_dst = 192.168.20.2
duration = 6
bandwidth = 3
set_arp = 1
bidirectional = 1
dp_src = 1
dp_dst = 3
first_port = 2
last_port = 2
dl_src = a6:8a:d7:63:1e:49
dl_dst = c6:10:36:4a:20:7f
Response status code 200 : OK
************** Response: ***************
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "reversPath": "7a8b", 
        "directPath": "dc6b"
    }
}

Get info about a virtual path

Verb URI Description
GET /netic.v1/OFNIC/virtualpath/{PathID} Retrieve all available information about the virtualpath with id :PathID

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

GET https://127.0.0.1:2222/netic.v1/OFNIC/virtualpath/7a8b
Response status code 200 : OK
************** Response: ***************
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "DestIP": "192.168.20.2", 
        "TimeRemaining": 46, 
        "Nodes": [
            1, 
            2, 
            3
        ], 
        "SourceIP": "192.168.10.2", 
        "Bandwidth": 30
    }
}

Remove a virtual path

Verb URI Description
DELETE /netic.v1/OFNIC/virtualpath/{PathID} Removes an already created virtualpath with path id: PathID.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1:2222/netic.v1/OFNIC/virtualpath/a481
Response status code: 204

Monitor

Monitor group of commands provides the APIs to retrieve collected network statistics about ports of network nodes as well as to create new monitoring tasks. A monitoring task means that the NetIC GE start the monitoring of a flow in a certain node of the network for a certain period of time with a certain polling frequency. Parameters collected are amount of bytes transmitted per unit of time and number of packets transmitted per unit of time. The Monitor commands are explained below.


Get port statistics

Verb URI Description
GET /netic.v1/statistics/node/{nID}/port/{pID} Retrieve all available statistics about port with id: pID in node with id: nID


Normal Response Code(s): 200 OK

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)


Example

GET https://127.0.0.1:2222/netic.v1/OFNIC/statistics/node/1/port/2

{
    "resultCode": 0,
    "displayError": "No error",
    "result": {
        "Tx_bytes": 340,
        "Rx_bytes": 60,
    }
}

List all monitoring tasks

Verb URI Description
GET /netic.v1/statistics/task List all monitoring tasks already created in the network.



Normal Response Code(s): 200 OK

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)


Example

GET https://127.0.0.1:2222/netic.v1/OFNIC/statistics/task
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "MonitorIDs": [
            "fae9fd57",
            "1ffe3945"
        ]
    }
}

Create new monitoring task

Verb URI Description
POST /netic.v1/statistics/task/create Create a new monitoring task.


Parameter Meaning Importance Notes
PathID ID of the path to be monitored Mandatory parameter 4 digit hex number
dpid ID of the node on which the
path should be monitored
Mandatory parameter Unsigned int of 64 bits
duration Duration of the monitoring task Mandatory parameter Unit in seconds
frequency How many times per minute
the node will be polled
Mandatory parameter Unsigned int of 16 bits

Normal Response Code(s): 200 OK

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

POST https://127.0.0.1:2222/netic.v1/OFNIC/statistics/task/create
PathID = a481
dpid = 1
duration = 60
frequency = 1
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "MonitorID": "fae9fd57"
    }
}

Get monitoring task statistics

Verb URI Description
GET /netic.v1/OFNIC/statistics/task/{MonitorID} Retrieve the collected statistics from this monitoring task with id: MonitorID

Normal Response Code(s): 200 OK

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1:2222/netic.v1/OFNIC/statistics/task/fae9fd57
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "Byte_per_s": 714, 
        "Packet_per_s": 1
    }
}

Delete monitoring task

Verb URI Description
DELETE /netic.v1/OFNIC/statistics/task/{MonitorID} Remove the already created monitoring task with id: MonitorID

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1:2222/netic.v1/OFNIC/statistics/task/fae9fd57
Response status code: 204

Access Control

Get the list of all Resouces

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/res Get a list of all the resources of the web server

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415) Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/res
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "res": [
            {
                "Path": "/netic.v1/OFNIC/statistics", 
                "IDs": [
                    "6", 
                    "16"
                ], 
                "Caps": [
                    "STAT", 
                    "GET"
                ]
            }, 
            {
                "Path": "/netic.v1/OFNIC/statistics/task", 
                "IDs": [
                    "7", 
                    "17"
                ], 
                "Caps": [
                    "STAT", 
                    "GET"
                ]
            }
        ]
    }
}

Get capabilities of a resource

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/res/{id}/caps Get a list of all capabilities needed to access a certain resource. (Use : instead of / as a delimiter)

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/res/netic.v1:OFNIC:statistics:task/caps
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "caps": [
            {
                "Cap": "STAT"
            }, 
            {
                "Cap": "GET"
            }
        ]
    }
}

Add capability requirement to resource

Verb URI Description
POST /netic.v1/OFNIC/controlpanel/res/{id}/caps/{id} Add a capability requirement to a resource.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415) Example

POST https://127.0.0.1/netic.v1/OFNIC/controlpanel/res/netic.v1:OFNIC:statistics:task/caps/STAT
{
    "action": "Selected capability added to the selected resource", 
    "res": "netic.v1:OFNIC:statistics:task",  
    "newcap": "STAT", 
    "result": "SUCCESS"
}

Remove capability requirement from a resource

Verb URI Description
DELETE /netic.v1/OFNIC/controlpanel/res/{res_id}/caps/{cap_id} Remove a capability from a resource.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415) This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/controlpanel/res/netic.v1:OFNIC:statistics:task/caps/STAT
{
    "action": "Selected capability deleted from the selected resource set", 
    "res": "netic.v1:OFNIC:statistics:task", 
    "cap": "STAT", 
    "result": "SUCCESS"
}

Get all Roles

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/role Get all available roles.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/role
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "roles": [
            {
                "Name": "Admin"
            }, 
            {
                "Name": "Demo"
            }, 
            {
                "Name": "No Access"
            }, 
            {
                "Name": "Readonly"
            }, 
            {
                "Name": "route"
            }, 
            {
                "Name": "StatManager"
            }, 
            {
                "Name": "Superuser"
            }
        ]
    }
}

Remove an editable role

Verb URI Description
DELETE /netic.v1/OFNIC/controlpanel/role/{role_ID} Remove an existing editable role.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/controlpanel/role/route
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "role": "route", 
        "result": "Role successfully removed"
    }
}

Get capabilities of role

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/role/{role_ID}/caps Get a list of all capabilites owned by the role.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/role/StatManager/caps
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "caps": [
            {
                "Cap": "DELETE"
            }, 
            {
                "Cap": "GET"
            }, 
            {
                "Cap": "POST"
            }, 
            {
                "Cap": "STAT"
            }, 
            {
                "Cap": "SYNC"
            }
        ]
    }
}

Add capability to role

Verb URI Description
POST /netic.v1/OFNIC/controlpanel/role/{role_ID}/caps/{cap_name} Add a capability to the set of capabilities of an Editable Role.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

POST https://127.0.0.1/netic.v1/OFNIC/controlpanel/role/StatManager/caps/SYNC
{
    "action": "Selected capability added to the selected editable role", 
    "newcap": "SYNC", 
    "role": "StatManager", 
    "result": "SUCCESS"
}

Remove capability from role

Verb URI Description
DELETE /netic.v1/OFNIC/controlpanel/role/{role_ID}/caps/{cap_name} Delete a capability from an editable Role set.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/controlpanel/role/StatManager/caps/STAT
{
    "action": "Selected capability deleted from the selected editable role", 
    "cap": "STAT",
    "role": "StatManager", 
    "result": "SUCCESS"
}

Create a new Role

Verb URI Description
POST /netic.v1/OFNIC/controlpanel/role/create/{new_role} Add a new editable role.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

POST https://127.0.0.1/netic.v1/OFNIC/controlpanel/role/create/RouteMgr
{
    "action": "New editable role added to the database", 
    "default capability": "GET", 
    "role": "RouteMgr", 
    "result": "SUCCESS"
}

Get all editable roles

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/editableroles Get all available editable roles.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/editableroles
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "roles": [
            {
                "Name": "StatManager"
            }, 
            {
                "Name": "RouteMgr"
            }
        ]
    }
}

Get the list of all Capabilities

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/caps Get a list of all defined capabilities.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/caps
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "caps": [
            {
                "Admin": 1, 
                "Demo": 0, 
                "Readonly": 0, 
                "Name": "RESERVED", 
                "Description": "Capability to access reserved areas, like the Control Panel"
            }, 
            {
                "Admin": 1, 
                "Demo": 1, 
                "Readonly": 1, 
                "Name": "GET", 
                "Description": "Capability to access resources which require method GET"
            }, 
            {
                "Admin": 1, 
                "Demo": 1, 
                "Readonly": 0, 
                "Name": "ROUTE", 
                "Description": "Capability to access the routing resources"
            }, 
            {
                "Admin": 1, 
                "Demo": 0, 
                "Readonly": 0, 
                "Name": "DELETE", 
                "Description": "Capability to access resources which require method DELETE"
            }, 
            {
                "Admin": 1, 
                "Demo": 1, 
                "Readonly": 0, 
                "Name": "POST", 
                "Description": "Capability to access resources which require method POST"
            }, 
            {
                "Admin": 1, 
                "Demo": 1, 
                "Readonly": 0, 
                "Name": "SYNC", 
                "Description": "Capability to access the sync resources"
            }, 
            {
                "Admin": 1, 
                "Demo": 1, 
                "Readonly": 0, 
                "Name": "STAT", 
                "Description": "Capability to access the stat resources"
            }
        ]
    }
}

Get the list of all users

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/user Get the list of all registered users.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/user
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "users": [
            {
                "username": "admin"
            }, 
            {
                "username": "demo"
            }, 
            {
                "username": "routeDemo"
            }, 
            {
                "username": "test"
            }
        ]
    }
}

Remove a user

Verb URI Description
DELETE /netic.v1/OFNIC/controlpanel/user/{username} Delete a user.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/controlpanel/user/test
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "result": "User succesfully removed", 
        "user": "test"
    }
}

Get the set of user's roles

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/user/{username}/roles Get a list of all roles possessed by a user.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/user/admin/roles
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "roles": [
            {
                "Role": "Admin"
            },
            {
                "Role": "Superuser"
            }
        ]
    }
}

Add role to user

Verb URI Description
POST /netic.v1/OFNIC/controlpanel/user/{username}/roles/{role_ID} Add a role to the specified user.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

POST https://127.0.0.1/netic.v1/OFNIC/controlpanel/user/demo/roles/StatManager
{
    "action": "Selected role added to the selected user", 
    "role": "StatManager", 
    "user": "demo", 
    "result": "SUCCESS"
}

Remove a role from user

Verb URI Description
DELETE /netic.v1/OFNIC/controlpanel/user/{username}/roles/{role_ID} Remove a role from the specified user.

Normal Response Code(s): 204

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

This operation does not require a request body or return a response body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/controlpanel/user/demo/roles/StatManager
{
    "action": "Selected role deleted from the selected user", 
    "role": "StatManager", 
    "user": "demo", 
    "result": "SUCCESS"
}

Get all user roles

Verb URI Description
GET /netic.v1/OFNIC/controlpanel/userroles Get the list of all user roles.

Normal Response Code(s): 200 OK Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), badMediaType (415)

Example

GET https://127.0.0.1/netic.v1/OFNIC/controlpanel/userroles
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "user_roles": [
            {
                "User": "admin", 
                "Roles": [
                    "Admin"
                ]
            }, 
            {
                "User": "netic", 
                "Roles": [
                    "Readonly", 
                    "Demo"
                ]
            }, 
            {
                "User": "demo", 
                "Roles": [
                    "Readonly"
                ]
            }, 
            {
                "User": "routeDemo", 
                "Roles": [
                    "Readonly"
                ]
            }
        ]
    }
}

StaticFlow

StaticFlow functionalities allows to manipulate the configuration of the network acting on the configuration of each OpenFlow switch.

List all installed static flow

Verb URI Description
GET /netic.v1/OFNIC/staticflow Get a list of currently installed static flow paths.

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

GET https://127.0.0.1/netic.v1/OFNIC/staticflow
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "flowIDs": [
            "57aa4567", 
            "946d7397"
        ]
    }
}

Create

Verb URI Description
POST /netic.v1/OFNIC/staticflow/create Install a new static flow in the network.


Parameter Meaning Importance Notes
flow_name Name of the static flow Mandatory parameter Alphanumeric, e.g. sflow1234
nw_src IP address of the source
of the flow
Mandatory parameter Dotted notation, e.g. 192.168.1.1
nw_dst IP address of the destination
of the flow
Mandatory parameter Dotted notation, e.g. 192.168.1.2
dp_id Node ID ID of the switch where you want to install the flow rule Unsigned int of 64 bits
duration Duration of the static flow rule Mandatory parameter Unit in seconds
inport Input port of the flow's packets Mandatory parameter Unsigned int of 16 bits
outport Output port of the flow's packets Mandatory parameter Unsigned int of 16 bits
queue Set to 0 if the QoS queues being not used, set to queue ID to forwarding packets using the specified QoS queue Mandatory parameter
bidirectional Set to 1 or 0 if the reverse static
flow is needed or not, respectively
Mandatory parameter

Example

POST https://127.0.0.1/netic.v1/OFNIC/staticflow/create
flow_name = test
nw_src = 192.168.10.2
nw_dst = 192.168.20.2
dp_id = 1
duration = 100
inport = 1
outport = 2
queue = 
bidirectional = 1
Response status code 200 : OK
************** Response: ***************
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "direct_flow": "946d3594", 
        "inverse_flow": "57aa7510"
    }
}

Get static flow information

Verb URI Description
GET /netic.v1/OFNIC/staticflow/{flow_ID} Retrieve static flow information.

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

GET https://127.0.0.1/netic.v1/OFNIC/staticflow/57aa9461
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {
        "outport": 1, 
        "inport": 2, 
        "queue": "", 
        "switch": 1, 
        "cookie": 6225775940663018745, 
        "duration": 10000, 
        "ID": "57aa9461"
    }
}

Delete static flow

Verb URI Description
DELETE /netic.v1/OFNIC/staticflow/{flow_ID} Remove a previously created staticflow.

Normal Response Code(s): 200

Error Response Code(s): identityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)

This operation does not require a request body.

Example

DELETE https://127.0.0.1/netic.v1/OFNIC/staticflow/57aa9461
{
    "resultCode": 0, 
    "displayError": "No error", 
    "result": {}
}
Personal tools
Create a book