Chapter 4 /sdn/v2.0/of

Stats

Sample request 

List controller statistics for all controllers that are part of this controller's team:

GET /sdn/v2.0/of/stats

There is no request body for this API.

Sample response 

{
    "controller_stats": [
        {
            "duration_ms": 8413750, 
            "lost": {
                "bytes": 0, 
                "packets": 0
            }, 
            "msg_in": 3178, 
            "msg_out": 1594, 
            "packet_in": {
                "bytes": 0, 
                "packets": 0
            }, 
            "packet_out": {
                "bytes": 38920, 
                "packets": 556
            }, 
            "uid": "aa079dc9-b9ec-4e15-a2ee-b753c2d02397"
        }
    ]
} 

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Stats/ports

Sample request 

List all port statistics:

GET /sdn/v2.0/of/stats/ports

List port statistics for a specific datapath:

GET /sdn/v2.0/of/stats/ports?dpid="00:64:74:46:a0:ff:07:00"

List port statistics for a specific port:

GET /sdn/v2.0/of/stats/ports?dpid="00:64:74:46:a0:ff:07:00"&port=3

There is no request body for this API.

Sample response 

The response includes port statistics grouped by datapaths.

{
    "stats": [
        {
            "dpid": "00:64:74:46:a0:ff:07:00", 
            "port_stats": [
                {
                    "collisions": 0, 
                    "duration_nsec": 4294967295, 
                    "duration_sec": 4294967295, 
                    "port_id": 24, 
                    "rx_bytes": 86162, 
                    "rx_crc_err": 0, 
                    "rx_dropped": 0, 
                    "rx_errors": 0, 
                    "rx_frame_err": 0, 
                    "rx_over_err": 0, 
                    "rx_packets": 860, 
                    "tx_bytes": 204628, 
                    "tx_dropped": 0, 
                    "tx_errors": 0, 
                    "tx_packets": 1594
                }, 
                {
                    "collisions": 0, 
                    "duration_nsec": 4294967295, 
                    "duration_sec": 4294967295, 
                    "port_id": 4294967294, 
                    "rx_bytes": 0, 
                    "rx_crc_err": 0, 
                    "rx_dropped": 0, 
                    "rx_errors": 0, 
                    "rx_frame_err": 0, 
                    "rx_over_err": 0, 
                    "rx_packets": 0, 
                    "tx_bytes": 0, 
                    "tx_dropped": 0, 
                    "tx_errors": 0, 
                    "tx_packets": 0
                }, 
                {
                    "collisions": 0, 
                    "duration_nsec": 4294967295, 
                    "duration_sec": 4294967295, 
                    "port_id": 23, 
                    "rx_bytes": 86226, 
                    "rx_crc_err": 0, 
                    "rx_dropped": 0, 
                    "rx_errors": 0, 
                    "rx_frame_err": 0, 
                    "rx_over_err": 0, 
                    "rx_packets": 861, 
                    "tx_bytes": 207300, 
                    "tx_dropped": 0, 
                    "tx_errors": 0, 
                    "tx_packets": 1583
                }
            ], 
            "version": "1.3.0"
        }
    ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Stats/groups

List group statistics

Sample request 

List all group statistics:

GET /sdn/v2.0/stats/groups

List all group statistics from a given datapath:

GET /sdn/v2.0/stats/groups?dpid="00:00:00:00:00:00:00:02"

List the group statistics for a given group:

GET /sdn/v2.0/stats/groups?dpid="00:00:00:00:00:00:00:02"&group_id=2

There is no request body for this API.

Sample response 

{
   "stats":[
      {
         "dpid":"00:0c:00:24:a8:cc:78:00",
         "version":"1.3.0",
         "group_stats":[
            {
               "id":121,
               "ref_count":0,
               "packet_count":0,
               "byte_count":0,
               "duration_sec":30,
               "duration_nsec":773000000,
               "bucket_stats":[
                  {
                     "packet_count":0,
                     "byte_count":0
                  }
               ]
            }
         ]
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Meter statistics

Sample request 

List all meter statistics:

GET /sdn/v2.0/of/stats/meters

List meter statistics for a specific datapath:

GET /sdn/v2.0/of/stats/meters?dpid="00:64:74:46:a0:ff:07:00"

List meter statistics for a specific meter:

GET /sdn/v2.0/of/stats/meters?dpid="00:64:74:46:a0:ff:07:00"&meter_id=3

There is no request body for this API.

Sample response 

{
   "stats":[
      {
         "dpid":"00:64:74:46:a0:ff:07:00",
         "meter_stats":[
            {
               "band_stats":[
                  {
                     "byte_count":0,
                     "packet_count":0
                  },
                  {
                     "byte_count":0,
                     "packet_count":0
                  }
               ],
               "byte_count":0,
               "duration_nsec":3801967296,
               "duration_sec":3664433282,
               "flow_count":0,
               "id":1,
               "packet_count":0
            }
         ],
         "version":"1.3.0"
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)