HP VAN SDN Controller 2.2 REST API Abstract This guide is intended for network administrators and support personnel, and provides commands, sample requests, sample responses, and response codes for interacting with the API. The information in this guide is subject to change without notice.
© Copyright 2014 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
Contents 1 Controller REST API overview........................................................................7 2 Controller REST API list................................................................................8 3 /sdn/v2.0...............................................................................................15 Versions................................................................................................................................15 {base uri}.................................
Systems/{system uid}..........................................................................................................32 Get information on the given controller.............................................................................32 Systems/{system uid}/action................................................................................................33 Backup system..............................................................................................................
Datapaths/{dpid}/controllers..............................................................................................54 Datapaths/{dpid}/features/meter........................................................................................55 Datapaths/{dpid}/features/group........................................................................................55 Datapaths/{dpid}/ports......................................................................................................
Get the next hop switch of the specified switch based on the packet identifier........................79 Diag/packets{packet uid}/action.........................................................................................79 Simulate a packet.........................................................................................................
1 Controller REST API overview The Controller REST API is distributed across 3 distinct namespaces: core (/sdn/v2.0), openflow (/sdn/v2.0/of), and network services (/sdn/v2.0/net). Each namespace has its own JSON schema to describe the JSON data format and can be accessed directly at the URL /sdn/v2.0/models. The core APIs provide general manageability of the controller, such as configuration, health monitoring, teaming, alerts, audit logs, support logs, etc.
2 Controller REST API list Base URI Noun URI Verb /sdn/v2.
/configs/{component} GET List configurations for the given component /configs/{component} PUT List the configurations for the given component /configs/{component} DELETE Parse delete the specified configurations for the given component (deleted configuration items will revert to their default values) /apps GET List all apps deployed on this controller /apps POST Deploy a new app to staging to run on the HP VAN SDN Controller /apps/{app_uid} DELETE Undeploy an app /apps/{app_uid} PUT Rede
non-teamed controller /systems/{system_uid}/ action POST Take a given action (backup/restore) on a controller /systems/{system_uid}/ backup GET Retrieve system's backup information. If download filter is present, the latest backup image of the system will be returned. If csum is present, the cksum file is returned.
Metrics Stats /alerts/listeners/ {listener_uid} GET Get info on a listener /alerts/listeners/ {listener_uid} DELETE Remove a listener /alerts/listeners/ {listener_uid} PUT Update a listener /metrics/apps GET List the names and IDs of all applications that have metrics persisted on the system /metrics/primaries GET app_id, name, List all primary secondary_tag tags based on the query parameters /metrics/secondaries GET app_id, name, List all primary_tag secondary tags based on the query par
Datapaths /sdn/v2.0/of /sdn/v2.0 /net Clusters Links 12 Controller REST API list /stats/groups GET dpid, group_id List stats for all 1.3 groups (ofp_group_stats) /stats/meters GET dpid, meter_id List stats for all 1.3 meters (ofp_meter_stats) /datapaths GET List all datapaths 1.0,1.3 /datapaths/{dpid} GET Get info on a datapath 1.0,1.3 /datapaths/{dpid}/ controllers GET Get controller info on a datapath 1.0,1.
presented, list all neighboring links with respect to that dpid. /sdn/v2.
/diag/packets/ {packet_uid}/nexthop GET /diag/packets/ {packet_uid}/action 14 Controller REST API list POST src_dpid Get the next hop switch based on the packet uid and the current dpid that the packet is at Take an action (e.g.
3 /sdn/v2.0 Versions {base uri} This is an unauthenticated API. Sample request GET / There is no request data. Sample response { "versions": [ { "id": "/sdn/v2.0", "links": [ { "href": "https://15.255.121.2:8443/sdn/v2.0", "rel": "self" } ] } ] } Response codes • Normal: OK (200) • Error: Not Found (404), Service Unavailable (503) {base uri}/{api} This is an unauthenticated API. Sample request GET /sdn/v2.0 There is no request data. Sample response { "version": { "build": "1.21.0.
"rel": "describedBy", "type": "text/html" } ], "status": "CURRENT" } } Response codes • Normal: OK (200) • Error: Not Found (404), Service Unavailable (503) Support REST API: /sdn/v2.0/support Sample request Get a full support report: GET /sdn/v2.0/support Get a support report for a specific ID: GET /sdn/v2.0/support?id="artifact" Get a support report for all IDs, but show only "title" and "content" fields: GET /sdn/v2.
"Topology Viewer, Version: 1.21.0.SNAPSHOT, State: ACTIVE", "Link Manager, Version: 1.21.0.SNAPSHOT, State: ACTIVE" ], "id": "application-Management", "title": "Application Manager" }, { "content": [ "Audit Log Count: 4", "Data Retention Age Out: 365 days", "Data Trim Interval: 24 hours", "Data Trim Enabled: true", "Last trim conducted at: Wed Oct 16 14:15:07 PDT 2013" ], "id": "audit_log", "title": "Audit Log Framework" }, { "content": [ "OS architecture: amd64", "OS Name: Linux", "OS Version: 3.2.
Licensing Licenses List licenses Sample request List all licenses GET /sdn/v2.0/licenses There is no request body for this API. Sample response 1 { 2 "licenses" : [ { 3 "install_id" : 1234567, 4 "serial_no" : 10, 5 "license_metric" : "Controller Node", 6 "product" : "HP VAN SDN Ctrl Base", 7 "metric_qty" : 50, 8 "license_type" : "DEMO", 9 "base_license" : true, 10 "creation_date" : "2013-06-25T23:51:09.826Z", 11 "activated_date" : "2013-06-22T23:51:09.826Z", 12 "expiry_date" : "2023-06-25T23:51:09.
Sample response 1 { 2 "license" : { 3 "install_id" : 1234567, 4 "serial_no" : 10, 5 "license_metric" : "Controller Node", 6 "product" : "HP VAN SDN Ctrl Base", 7 "metric_qty" : 50, 8 "license_type" : "DEMO", 9 "base_license" : true, 10 "creation_date" : "2013-06-25T23:51:09.826Z", 11 "activated_date" : "2013-06-22T23:51:09.826Z", 12 "expiry_date" : "2023-06-25T23:51:09.
Installid Get the install id Sample request GET /sdn/v2.0/licenses/installid There is no request body for this API. Sample response A mere string will be returned e.g. 12345678 Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Bad Method (405), Service Unavailable (503) Get a license Get a license by serial number Sample request Get a license by given serial number: GET /sdn/v2.0/licenses/10 There is no request body for this API.
Request body will be: deactivate Sample response 1 { 2 "license" : { 3 "install_id" : 1234567, 4 "serial_no" : 10, 5 "license_metric" : "Controller Node", 6 "product" : "HP VAN SDN Ctrl Base", 7 "metric_qty" : 50, 8 "license_type" : "DEMO", 9 "base_license" : true, 10 "creation_date" : "2013-06-25T23:51:09.826Z", 11 "activated_date" : "2013-06-22T23:51:09.826Z", 12 "expiry_date" : "2023-06-25T23:51:09.
Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Bad Method (405), Service Unavailable (503) Config es List config Sample request Get configuration for all apps on this controller team: GET /sdn/v2.0/configs There is no request body for this API. Sample response {"configs": [ {"com.hp.sdn.adm.alert.impl.AlertManager": { "trim.alert.age": { "def_val": "14", "desc": "Days an alert remains in storage (1 - 31)", "val": "14" }, "trim.
Config/{component} List config for a given component Sample request Get configuration for the "com.hp.sdn.net" component: GET /sdn/v2.0/configs/com.hp.sdn.adm.alert.impl.AlertManager There is no request body for this API. Sample response { "config": { "com.hp.sdn.adm.alert.impl.AlertManager": { "trim.alert.age": { "def_val": "14", "desc": "Days an alert remains in storage (1 - 31)", "val": "14" }, "trim.enabled": { "def_val": "true", "desc": "Allow trim operation (true/false)", "val": "true" }, "trim.
"val": "true" }, "trim.frequency": { "def_val": "24", "desc": "Frequency in hours of trim operations (8 - 168)", "val": "12" } } } } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Revert to default config for a given component Sample request Delete specified configuration items for the "com.hp.sdn.net" component: DELETE /sdn/v2.0/configs/com.hp.sdn.net {"config":["trim.
Apps List apps Sample request List all apps: GET /sdn/v2.0/apps There is no request body for this API. Sample response { "apps": [ { "deployed": "2013-10-16T21:15:09.793Z", "desc": "Path analysis", "name": "Path Daemon", "state": "ACTIVE", "uid": "com.hp.sdn.ctl.path", "vendor": "Hewlett-Packard", "version": "1.21.0.SNAPSHOT" }, { "deployed": "2013-10-16T21:15:10.384Z", "desc": "Node Management", "name": "Node Manager", "state": "ACTIVE", "uid": "com.hp.sdn.ctl.
"state": "ACTIVE", "uid": "com.hp.sdn.ctl.linkdisco", "vendor": "Hewlett-Packard", "version": "1.21.0.SNAPSHOT" } ] } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503 Deploy app Sample request Deploy app to staging: POST /sdn/v2.0/apps Request body is binary data, consisting of the binary that make up the Aurora controller to be deployed.
"vendor": "Hewlett-Packard", "version": "1.21.0.SNAPSHOT" } } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Un-deploy app Sample request Un-deploy app: DELETE /sdn/v2.0/apps/com.hp.sdn.tvue There is no request body for this API. Sample response There is no response body for this API.
Enable a stopped app Sample request Enable a disabled app: POST /sdn/v2.0/apps/{app_uid}/action Request body: enable Sample response { "app": { "deployed": "2013-10-16T21:15:10.922Z", "desc": "Topology Viewer", "name": "Topology Viewer", "state": "ACTIVE", "uid": "com.hp.sdn.tvue", "vendor": "Hewlett-Packard", "version": "1.21.0.
Apps/{app uid}/health Get app health Sample request Get app health: GET /sdn/v2.0/apps/{app_uid}/health There is no request body for this API. Sample response { "app": { "deployed": "2013-10-16T21:15:10.922Z", "name": "Topology Viewer", "state": "ACTIVE", "status": "OK", "uid": "com.hp.sdn.
There is no request body for this API. Sample response Response data is an application/octet stream of the zip file containing the controller(s)'s logs. Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Logs/local Download the local controller logs as a zip file Sample request Download local controller logs: GET /sdn/v2.0/logs/local There is no request body for this API.
activity... optional; if specified returns only the audit logs with the specified activity; otherwise a wildcard start... optional; the inclusive start date of the requested time period in ISO-8601 format (Example: 2013-09-15T16:00:00.000Z) end... optional; the inclusive end date of the requested time period in ISO-8601 format (Example: 2013-09-15T16:00:00.000Z) There is no request body for this API.
Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Systems List controllers Sample request List all controllers: GET /sdn/v2.0/systems List controller by the given IP: GET /sdn/v2.0/systems?ip="192.168.1.100" There is no request body for this API. Sample response 1 { 2 "systems": [ 3 { 4 "uid": "adc5e492-957c-4f8c-aa0a-97fa2dac5f23", 5 "version": "01.11.00.
7 8 9 10 11 12 } 13 } "core_data_version": 0, "core_data_version_timestamp": "1970-01-01T00:00:00.000Z", "time": "1970-01-01T00:00:00.000Z", "self": true, "status": "active" Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Update the IP address of a non-teamed system Updating the IP address of a system applies only to a non-teamed system where the system information being updated is a representation of the system being called, i.e., "self":true.
Sample request POST /sdn/v2.0/systems/{system_uid}/action Valid request data: "backup" -- Backup the given system Sample response 1 { 2 3 4 5 6 }} "uri": "/sdn/v2.0/backups/23232323", "session_ids" : { "session_id" : "23232323", "nodetokens" : [] Location header: /sdn/v2.0/backups/{session_id} Response codes • Normal: Accepted (202) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Restore system This API is asynchronous. Sample request POST /sdn/v2.
Sample response { "session_ids": { "nodetokens": [], "session_id": "RY5jJjppLR" }, "uri": "https://15.255.124.47:8443/sdn/v2.0/backups/RY5jJjppLR" } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Download backup image Sample request Download the backup image for the given system: GET /sdn/v2.0/systems/{system uid}/backup?download=true There is no request body for this API.
Region Regions List regions Sample request List all regions: GET /sdn/v2.0/regions There is no request body for this API. Sample response 1 { 2 "regions" : [ { 3 "uid" : "adc5e492-957c-4f8c-aa0a-97fa2dac5f01", 4 "master" : { 5 "ip" : "125.200.104.101", 6 "name" : "Controller_1" 7 }, 8 "slaves" : [ { 9 "ip" : "125.200.104.102", 10 "name" : "Controller_2" 11 } ], 12 "devices" : [ { 13 "ip" : "125.200.104.
Sample response 1 { 2 "region" : { 3 "uid" : "adc5e492-957c-4f8c-aa0a-97fa2dac5f01", 4 "master" : { 5 "ip" : "125.200.104.101", 6 "name" : "Controller_1" 7 }, 8 "slaves" : [ { 9 "ip" : "125.200.104.102", 10 "name" : "Controller_2" 11 } ], 12 "devices" : [ { 13 "ip" : "125.200.104.200" 14 } ] 15 } 16 } Location header: http:///sdn/v2.
Update region Sample request Update a region with the give region uid: PUT /sdn/v2.0/regions/{region_uid} 1 { 2 "region" : { 3 "master" : { 4 "ip" : "125.200.104.101", 5 "name" : "Controller_1" 6 }, 7 "slaves" : [ { 8 "ip" : "125.200.104.102", 9 "name" : "Controller_2" 10 } ], 11 "devices" : [ { 12 "ip" : "125.200.104.200" 13 } ] 14 } 15 } Sample response 1 { 2 "region" : { 3 "uid" : "adc5e492-957c-4f8c-aa0a-97fa2dac5f01", 4 "master" : { 5 "ip" : "125.200.104.
Response codes • Normal: No Content (204) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Team Team List team membership Sample request Get team configuration for this controller: GET /sdn/v2.0/team There is no request body for this API. Sample response 1 { 2 "team": { 3 "name": "Test Cluster", 4 "ip": "192.168.139.111", 5 "version": "1374169868918", 6 "systems": [ 7 { 8 "name": "member 1", 9 "ip": "192.168.139.
5 "systems": [ 6 { 7 "name": "member 1", 8 "ip": "192.168.139.101", 9 "priority": 10 10 }, 11 { 12 "name": "member 2", 13 "ip": "192.168.139.102", 14 "priority": 20 15 }, 16 { 17 "name": "member 3", 18 "ip": "192.168.139.103", 19 "priority": 30 20 } 21 ] 22 } 23 "forward_request": true 24 } When the optional attribute forward_request=true (default is true), team configuration will be propogated to all the systems specified in the list.
Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Backup Backups/{session uid} Get backup session Sample request Get backup session with the given uid: GET /sdn/v2.0/backups/{session_uid} There is no request body for this API. Sample response 1 { 2 "statusCode": 3, 3 "Description": "Operation complete.
"uid": "d5704bb5-3415-484c-94d3-d57d1d334b2a" } ] } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Alerts/topics List alert topics Sample request List all alert topics: GET /sdn/v2.0/alerts/topics List all alert topics filtered by the given origin: GET /sdn/v2.0/alerts/topics?org="sentinel" There is no request body for this API.
Alerts/listeners List alert listeners Sample request List all alert listeners: GET /sdn/v2.0/alerts/listeners There is no request body for this API. Sample response 1 { 2 "alert_topic_listeners" : [ { 3 "uid" : "cb0f4bf2-a8f5-4b06-8937-abfc79d33423", 4 "app_id" : "imc", 5 "name" : "IMC OpenFLow Listener", 6 "callbacks" : [ { 7 "topics" : [ "of_controller", “of_controller_link” ], 8 "uri" : "http://imc.h3c.
Response codes • Normal: Created (201) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Alerts/listeners/{listener uid} Get info on an alert listener Sample request Get details on an alert listener: GET /sdn/v2.0/alerts/listeners/{listener_uid} There is no request body for this API.
8 "uri" : "http://imc.h3c.com/sdn" 9 } ] 10 } 11 } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Delete an alert listener Sample request Delete an alert listener: DELETE /sdn/v2.0/alerts/listeners/{listener_uid} There is no request body for this API. Sample response There is no response data for this API.
parameters: • app_id ... mandatory; if none specified, returns errors • name ... optional; if none specified, returns all metrics • primary_tag... optional; if none specified, the wild card is considered, if specified returns only the metrics with the specified primary tag • secondary_tag...
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 ]} "jmx":true, "persistence":true, "summary_interval":"ONE" }, { "name": "metric F", "type": "METER", "uid": "65f1a180-ab5e-4b41-8c9f-b1597a4d1205", "primary_tag":"computenode2", "secondary_tag":"router4", "description": "My sixth metric.
reported. If no value is specified for the start parameter but an end time is specified, the start will be date of the first instance of the metric within age_out time • end ... The end date of a requested time period in format YYYY-MM-dd-hh:mm, optional; if empty, the end will be the date of the REST call. • interval ... The time period to summarize the data, optional without both start and end but required if either or both specified; The intervals supported are: 1, 5, 15, 30, 60, "day", "all".
Sample response 1 {"names": [ 2 "rc_30000", 3 "rc_30001", 4 "rc_40001", 5 "rc_40000" 6 ] 7 } Northbound metering REST API examples 49
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 The response includes port statistics grouped by datapaths.
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.
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.
"device_port": 62075, "dpid": "00:64:74:46:a0:ff:07:00", "last_message": "2013-10-16T23:54:35.576Z", "negotiated_version": "1.3.0", "num_buffers": 0, "num_tables": 3, "ready": "2013-10-16T21:17:02.652Z" } ] } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Datapaths/{dpid} Sample request Get a datapath by its dpid: GET /sdn/v2.0/of/datapaths/{dpid} There is no request body for this API.
Sample response 1 { 2 3 4 5 6 7 8 9 } "controllers": { "master": "15.255.127.65", "slaves": [ "15.255.127.75", "15.255.127.85" ] } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Datapaths/{dpid}/features/meter Sample request List meter features for given datapath: GET /sdn/v2.0/of/datapaths/{dpid}/features/meter There is no request body for this API.
{ "all": [ "output" ] }, { "select": [ "output" ] } ], "capabilities": [ "select_liveness" ], "max_groups": [ { "all": 32 }, { "select": 32 } ], "types": [ "all", "select" ] }, "version": "1.3.0" } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Datapaths/{dpid}/ports Sample request List all ports for the given dpid: GET /sdn/v2.0/of/datapaths/{dpid}/ports There is no request body for this API.
"supported_features": [ "rate_10mb_hd", "rate_10mb_fd", "rate_100mb_hd", "rate_100mb_fd", "rate_1gb_fd", "rate_1tb_fd" ] }, { "advertised_features": [], "config": [], "current_features": [ "rate_1gb_fd", "rate_1tb_fd" ], "current_speed": 3567587328, "id": 24, "mac": "74:46:a0:ff:07:28", "max_speed": 3567587328, "name": "24", "peer_features": [], "state": [ "live" ], "supported_features": [ "rate_10mb_hd", "rate_10mb_fd", "rate_100mb_hd", "rate_100mb_fd", "rate_1gb_fd", "rate_1tb_fd" ] }, { "advertised_featu
Sample response The response includes port statistics grouped by datapaths. { "port": { "advertised_features": [], "config": [], "current_features": [ "rate_1gb_fd", "rate_1tb_fd" ], "current_speed": 3567587328, "id": 23, "mac": "74:46:a0:ff:07:29", "max_speed": 3567587328, "name": "23", "peer_features": [], "state": [ "live" ], "supported_features": [ "rate_10mb_hd", "rate_10mb_fd", "rate_100mb_hd", "rate_100mb_fd", "rate_1gb_fd", "rate_1tb_fd" ] }, "version": "1.3.
Datapaths/{dpid}/meters List meters Sample request List all meters: GET /sdn/v2.0/of/datapaths/{dpid}/meters There is no request body. Sample response { "meters": [ { "bands": [ { "burst_size": 1000, "mtype": "drop", "rate": 1500 }, { "burst_size": 1000, "mtype": "dscp_remark", "prec_level": 1, "rate": 100 } ], "flags": [ "kbps", "burst", "stats" ], "id": 1 } ], "version": "1.3.
], "bands": [ { "burst_size": 1000, "rate": 1500, "mtype": "drop" }, { "burst_size": 1000, "rate": 100, "mtype": "dscp_remark", "prec_level": 1 } ] } } Sample response { "meter": { "bands": [ { "burst_size": 1000, "mtype": "drop", "rate": 1500 }, { "burst_size": 1000, "mtype": "dscp_remark", "prec_level": 1, "rate": 100 } ], "flags": [ "kbps", "burst", "stats" ], "id": 1 }, "version": "1.3.0" } Location header: /sdn/v2.
Sample response { "meter": { "bands": [ { "burst_size": 1000, "mtype": "drop", "rate": 1500 }, { "burst_size": 1000, "mtype": "dscp_remark", "prec_level": 1, "rate": 100 } ], "flags": [ "kbps", "burst", "stats" ], "id": 1 }, "version": "1.3.0" } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Update meter Sample request Update a meter with the given id: PUT /sdn/v2.0/of/datapaths/{dpid}/meters/{meter_id} Sample request body: { "version": "1.3.
} } Sample response { "meter": { "bands": [ { "burst_size": 1000, "mtype": "drop", "rate": 1500 }, { "burst_size": 2000, "mtype": "dscp_remark", "prec_level": 1, "rate": 200 } ], "flags": [ "kbps", "burst", "stats" ], "id": 1 }, "version": "1.3.0" } Response codes • Normal: OK (200) • Error: Bad Request (400), Unauthorized (401), Service Unavailable (503) Delete meter Sample request Delete a meter with the given id: DELETE /sdn/v2.0/of/datapaths/{dpid}/meters/{meter_id} There is no request body.
List flows for a given table_id: GET /sdn/v2.0/of/datapaths/{dpid}/flows?table_id=200 There is no request body. Sample response { "flows": [ { "byte_count": 0, "cookie": "0xffff000000000000", "duration_nsec": 488000000, "duration_sec": 10019, "flow_mod_flags": [ "send_flow_rem" ], "hard_timeout": 0, "idle_timeout": 0, "instructions": [ { "apply_actions": [ { "output": "CONTROLLER" } ] } ], "match": [], "packet_count": 0, "priority": 0, "table_id": 200 } ], "version": "1.3.
"instructions": [{"apply_actions": [{"output": 1}]}] }} Sample response There is no response data. Location header: /sdn/v2.0/of/datapaths/{dpid}/flows Response codes • Normal: Created (201) • Error: Bad Request (400), Unauthorized (401), Not Found (404), Service Unavailable (503) Update a flow Sample request Update a flow: PUT /sdn/v2.0/of/datapaths/{dpid}/flows Refer to sample request in flow create. However, if the given flow match and priority are not found, a 404 error will be returned.
Datapaths/{dpid}/groups List groups Sample request List all groups for the given dpid: GET /sdn/v2.0/of/datapaths/{dpid}/groups There is no request data. Sample response { "groups": [ { "buckets": [ { "actions": [ { "output": 24 } ], "watch_group": "ANY", "watch_port": "ANY", "weight": 0 } ], "id": 1, "type": "all" } ], "version": "1.3.
} } Sample response { "version": "1.3.0", "group": { "id": 1, "type": "all", "buckets": [{ "weight": 0, "watch_group": "ANY", "watch_port": "ANY", "actions": [{"output": 24}] }] } } Response codes • Normal: Created (201) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Datapaths/{dpid}/groups/{group id} Get group information Sample request Get group information for the given dpid and group_id: GET /sdn/v2.0/of/datapaths/{dpid}/groups/{group_id} There is no request data.
Update group information Sample request Update group information for the given dpid and group_id: PUT /sdn/v2.0/of/datapaths/{dpid}/groups/{group_id} { "version": "1.3.0", "group": { "id": 1, "type": "select", "command": "modify", "buckets": [ { "weight": 1, "watch_group": "ANY", "watch_port": "ANY", "actions": [ {"output": 24} ] } ] } } Sample response { "version": "1.3.
5 /sdn/v2.0/net Clusters Sample request List all clusters: GET /sdn/v2.0/net/clusters There is no request body for this API.
Links Sample request List all links: GET /sdn/v2.0/net/links List all neighboring links associated with the given dpid (src or dst): GET /sdn/v2.0/net/links?dpid="00:00:00:00:00:00:00:02" There is no request body for this API.
Response codes • Normal: OK (200) • Error: Bad Request (400), Unauthorized (401), Not Found (404), Service Unavailable (503) ARPs Arps Sample request List all learned end host ARPs: GET /sdn/v2.0/net/arps List all learned end host ARPs for the given vlan: GET /sdn/v2.0/net/arps?vid=3 List all learned end host ARPs for the given host IP: GET /sdn/v2.0/net/arps?ip="10.0.0.3"&vid=3 There is no request body for this API. Sample response 1 {"arps": [{ 2 "ip": "10.0.0.
List all learned end hosts connected to the given datapath: GET /sdn/v2.0/net/nodes?dpid="00:00:00:00:00:00:00:02" List all learned end hosts connected to the given switch port: GET /sdn/v2.0/net/nodes?dpid="00:00:00:00:00:00:00:02"&port=3 There is no request body for this API. Sample response 1 {"nodes": [{ 2 "ip": "10.0.0.
3 "ports": [ 3, 5, 7 ] 4 }]} Sample response 1 {"lldp_suppressed": [{ 2 "dpid": "00:00:00:00:00:00:00:02", 3 "ports": [ 3, 5, 7 ] 4 }]} Response codes • Normal: Created (201) • Error: Bad Request (400), Unauthorized (401), Not Found (404), Service Unavailable (503) Remove port(s) from LLDP-suppressed list Sample request Delete the given port(s) from the LLDP-suppressed port list (bulk delete): DELETE /sdn/v2.
Sample response 1 {"observations": [ 2 { 3 "dpid": "00:00:00:00:00:00:00:01", 4 "type": "TCP", 5 "packet_uid": "1", 6 "status": "OK" 7 }, 8 { 9 "dpid": "00:00:00:00:00:00:00:01", 10 "type": "UDP", 11 "packet_uid": "2" 12 }, 13 { 14 "dpid": "00:00:00:00:00:00:00:02", 15 "type": "UDP", 16 "packet_uid": "2" 17 }, 18 { 19 "dpid": "00:00:00:00:00:00:00:03", 20 "type": "UDP", 21 "packet_uid": "2" 22 }, 23 { 24 "dpid": "00:00:00:00:00:00:00:03", 25 "type": "DHCP", 26 "packet_uid": "3" 27 }, 28 { 29 "dpid": "00:00:
Response codes • Normal: Created (201) • Error: Bad Request (400), Unauthorized (401), Service Unavailable (503) Delete an observation post Sample request Delete an observation post with the given data path id and the packet identifier: DELETE /sdn/v2.0/diag/observations Sample request body: 1 {"observation": { 2 "dpid": "00:00:00:00:00:00:00:01", 3 "packet_uid": "1" 4 } 5 } Sample response There is no response body.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 }, "tcp": { "tcp_dst": 80, "tcp_src": 12345 } }, { "uid": "2", "eth": { "eth_src" : "01:01:01:01:01:01", "eth_dst" : "02:02:02:02:02:02", "eth_type": "0x0800(IPv4)", "vlan_vid" : "100", "vlan_priority" : "PRIORITY_5" }, "ip": { "ipv4_dst": "10.0.100.102", "ipv4_src": "10.0.100.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 ] 96 } "opcode": "BOOT_REQ", "boot_flags": "BROADCAST", "client_ip": "0.0.0.0", "your_client_ip": "0.0.0.0", "next_server_ip": "0.0.0.0", "relay_agent_ip": "0.0.0.0", "client_mac": "00:1E:0B:AE:D3:BE", "options": [ { "type": "DISCOVER" }, { "parameter_request_list": ["SUBNET_MASK","HOST_NAME"] } ] } } Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Create a packet Sample request POST /sdn/v2.
13 14 15 16 }, 17 "udp": { 18 19 20 } 21 } 22 } "ip_proto": "UDP", "ip_dscn": "CS0", "ip_scn": "NOT_ECT" "udp_dst": 152, "udp_src": 12345 Response codes • Normal: Created (201) • Error: Bad Request (400), Unauthorized (401), Service Unavailable (503) Diag/packets/{packet uid} List a packet Sample request List the packet with the specified packet identifier: GET /sdn/v2.0/diag/packets/2 There is no request body for this API.
There is no request body. Sample response There is no response body. Response codes • Normal: No Content (204) • Error: Unauthorized (401), Service Unavailable (503) Diag/packets/{packet uid}/path List the expected ordered path links that the packet shall take through the network Sample request List the expected ordered path links based on the specified packet identifier: GET /sdn/v2.0/diag/packets/2/path There is no request body for this API.
Response codes • Normal: OK (200) • Error: Unauthorized (401), Not Found (404), Service Unavailable (503) Diag/packets/{packet uid}/nexthops Get the next hop switch of the specified switch based on the packet identifier Sample request Get the next hop based on the packet identifier and the data path identifier: GET /sdn/v2.0/diag/packets/1/nexthop?src_dpid="00:00:00:00:00:00:00:01" There is no request body for this API.