aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/web')
-rw-r--r--framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/HostsWebResource.java24
-rw-r--r--framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/IntentsWebResource.java6
-rw-r--r--framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/StatisticsWebResource.java59
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Application.json80
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/ApplicationPost.json80
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Applications.json96
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Cluster.json45
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/ClusterNode.json28
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/ClusterPost.json42
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/DeviceGet.json77
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/DeviceGetPorts.json132
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/DevicesGet.json93
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Flows.json179
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/FlowsPost.json102
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Host.json54
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/HostPut.json49
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Hosts.json70
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/IntentHost.json34
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/IntentPoint.json62
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Intents.json60
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/LinksGet.json72
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/NetCfgGet.json93
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Paths.json94
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsLink.json54
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsTables.json76
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/StatisticsPorts.json107
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/Topology.json32
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/TopologyBroadcast.json13
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/TopologyCluster.json31
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/TopologyClusters.json48
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/TopologyClustersDevices.json22
-rw-r--r--framework/src/onos/web/api/src/main/resources/definitions/TopologyInfrastructure.json13
-rw-r--r--framework/src/onos/web/api/src/test/resources/org/onosproject/rest/post-flow.json2
-rw-r--r--framework/src/onos/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java2
34 files changed, 2024 insertions, 7 deletions
diff --git a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/HostsWebResource.java b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/HostsWebResource.java
index 455e4929..00cbdf2f 100644
--- a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/HostsWebResource.java
+++ b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/HostsWebResource.java
@@ -16,6 +16,7 @@
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
@@ -50,6 +51,7 @@ import java.io.InputStream;
import java.net.URI;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import static org.onlab.util.Tools.nullIsNotFound;
@@ -64,6 +66,7 @@ public class HostsWebResource extends AbstractWebResource {
@Context
UriInfo uriInfo;
public static final String HOST_NOT_FOUND = "Host is not found";
+ private static final String[] REMOVAL_KEYS = {"mac", "vlan", "location", "ipAddresses"};
/**
* Get all end-station hosts.
@@ -199,8 +202,9 @@ public class HostsWebResource extends AbstractWebResource {
while (ipStrings.hasNext()) {
ips.add(IpAddress.valueOf(ipStrings.next().asText()));
}
- //TODO remove elements from json node after reading them
- SparseAnnotations annotations = annotations(node);
+
+ // try to remove elements from json node after reading them
+ SparseAnnotations annotations = annotations(removeElements(node, REMOVAL_KEYS));
// Update host inventory
HostId hostId = HostId.hostId(mac, vlanId);
@@ -210,6 +214,22 @@ public class HostsWebResource extends AbstractWebResource {
}
/**
+ * Remove a set of elements from JsonNode by specifying keys.
+ *
+ * @param node JsonNode containing host information
+ * @param removalKeys key of elements that need to be removed
+ * @return removal keys
+ */
+ private JsonNode removeElements(JsonNode node, String[] removalKeys) {
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String, Object> map = mapper.convertValue(node, Map.class);
+ for (String key : removalKeys) {
+ map.remove(key);
+ }
+ return mapper.convertValue(map, JsonNode.class);
+ }
+
+ /**
* Produces annotations from specified JsonNode. Copied from the ConfigProvider
* class for use in the POST method.
*
diff --git a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/IntentsWebResource.java b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/IntentsWebResource.java
index a4dd9380..2c63db9c 100644
--- a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/IntentsWebResource.java
+++ b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/IntentsWebResource.java
@@ -70,7 +70,7 @@ public class IntentsWebResource extends AbstractWebResource {
/**
* Get all intents.
* Returns array containing all the intents in the system.
- *
+ * @rsModel Intents
* @return array of all the intents in the system
*/
@GET
@@ -84,7 +84,7 @@ public class IntentsWebResource extends AbstractWebResource {
/**
* Get intent by application and key.
* Returns details of the specified intent.
- *
+ * @rsModel Intents
* @param appId application identifier
* @param key intent key
* @return intent data
@@ -136,7 +136,7 @@ public class IntentsWebResource extends AbstractWebResource {
/**
* Submit a new intent.
* Creates and submits intent from the JSON request.
- *
+ * @rsModel IntentHost
* @param stream input JSON
* @return status of the request - CREATED if the JSON is correct,
* BAD_REQUEST if the JSON is invalid
diff --git a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/StatisticsWebResource.java b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/StatisticsWebResource.java
index 7a452044..284d3775 100644
--- a/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/StatisticsWebResource.java
+++ b/framework/src/onos/web/api/src/main/java/org/onosproject/rest/resources/StatisticsWebResource.java
@@ -36,6 +36,7 @@ import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link;
import org.onosproject.net.device.DeviceService;
+import org.onosproject.net.device.PortStatistics;
import org.onosproject.net.flow.FlowRuleService;
import org.onosproject.net.flow.TableStatisticsEntry;
import org.onosproject.net.link.LinkService;
@@ -153,4 +154,62 @@ public class StatisticsWebResource extends AbstractWebResource {
rootArrayNode.add(deviceStatsNode);
return ok(root).build();
}
+
+ /**
+ * Get port statistics of all devices.
+ * @rsModel StatisticsPorts
+ * @return JSON encoded array of port statistics
+ */
+ @GET
+ @Path("ports")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getPortStatistics() {
+ final DeviceService service = get(DeviceService.class);
+ final Iterable<Device> devices = service.getDevices();
+ final ObjectNode root = mapper().createObjectNode();
+ final ArrayNode rootArrayNode = root.putArray("statistics");
+ for (final Device device : devices) {
+ final ObjectNode deviceStatsNode = mapper().createObjectNode();
+ deviceStatsNode.put("device", device.id().toString());
+ final ArrayNode statisticsNode = deviceStatsNode.putArray("ports");
+ final Iterable<PortStatistics> portStatsEntries = service.getPortStatistics(device.id());
+ if (portStatsEntries != null) {
+ for (final PortStatistics entry : portStatsEntries) {
+ statisticsNode.add(codec(PortStatistics.class).encode(entry, this));
+ }
+ }
+ rootArrayNode.add(deviceStatsNode);
+ }
+
+ return ok(root).build();
+ }
+
+ /**
+ * Get port statistics of a specified devices.
+ * @rsModel StatisticsPorts
+ * @param deviceId device ID
+ * @return JSON encoded array of port statistics
+ */
+ @GET
+ @Path("ports/{deviceId}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getPortStatisticsByDeviceId(@PathParam("deviceId") String deviceId) {
+ final DeviceService service = get(DeviceService.class);
+ final Iterable<PortStatistics> portStatsEntries =
+ service.getPortStatistics(DeviceId.deviceId(deviceId));
+ final ObjectNode root = mapper().createObjectNode();
+ final ArrayNode rootArrayNode = root.putArray("statistics");
+ final ObjectNode deviceStatsNode = mapper().createObjectNode();
+ deviceStatsNode.put("device", deviceId);
+ final ArrayNode statisticsNode = deviceStatsNode.putArray("ports");
+ if (portStatsEntries != null) {
+ for (final PortStatistics entry : portStatsEntries) {
+ statisticsNode.add(codec(PortStatistics.class).encode(entry, this));
+ }
+ }
+ rootArrayNode.add(deviceStatsNode);
+
+ return ok(root).build();
+ }
+
}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Application.json b/framework/src/onos/web/api/src/main/resources/definitions/Application.json
new file mode 100644
index 00000000..ea6c3ea2
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Application.json
@@ -0,0 +1,80 @@
+{
+ "type": "object",
+ "title": "application",
+ "required": [
+ "name",
+ "id",
+ "version",
+ "description",
+ "origin",
+ "permissions",
+ "featuresRepo",
+ "features",
+ "requiredApps",
+ "state"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "example": "org.onosproject.distributedprimitives"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "version": {
+ "type": "string",
+ "example": "1.4.0.SNAPSHOT"
+ },
+ "description": {
+ "type": "string",
+ "example": "ONOS app to test distributed primitives"
+ },
+ "origin": {
+ "type": "string",
+ "example": "ON.Lab"
+ },
+ "permissions": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "featuresRepo": {
+ "type": "string",
+ "example": "mvn:org.onosproject/onos-app-cip/1.4.0-SNAPSHOT/xml/features"
+ },
+ "features": {
+ "type": "array",
+ "xml": {
+ "name": "features",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "onos-app-distributed-primitives"
+ }
+ },
+ "requiredApps": {
+ "type": "array",
+ "xml": {
+ "name": "requiredApps",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "state": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/ApplicationPost.json b/framework/src/onos/web/api/src/main/resources/definitions/ApplicationPost.json
new file mode 100644
index 00000000..ea6c3ea2
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/ApplicationPost.json
@@ -0,0 +1,80 @@
+{
+ "type": "object",
+ "title": "application",
+ "required": [
+ "name",
+ "id",
+ "version",
+ "description",
+ "origin",
+ "permissions",
+ "featuresRepo",
+ "features",
+ "requiredApps",
+ "state"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "example": "org.onosproject.distributedprimitives"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "version": {
+ "type": "string",
+ "example": "1.4.0.SNAPSHOT"
+ },
+ "description": {
+ "type": "string",
+ "example": "ONOS app to test distributed primitives"
+ },
+ "origin": {
+ "type": "string",
+ "example": "ON.Lab"
+ },
+ "permissions": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "featuresRepo": {
+ "type": "string",
+ "example": "mvn:org.onosproject/onos-app-cip/1.4.0-SNAPSHOT/xml/features"
+ },
+ "features": {
+ "type": "array",
+ "xml": {
+ "name": "features",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "onos-app-distributed-primitives"
+ }
+ },
+ "requiredApps": {
+ "type": "array",
+ "xml": {
+ "name": "requiredApps",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "state": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Applications.json b/framework/src/onos/web/api/src/main/resources/definitions/Applications.json
new file mode 100644
index 00000000..d7653619
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Applications.json
@@ -0,0 +1,96 @@
+{
+ "type": "object",
+ "title": "applications",
+ "required": [
+ "applications"
+ ],
+ "properties": {
+ "applications": {
+ "type": "array",
+ "xml": {
+ "name": "applications",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "application",
+ "required": [
+ "name",
+ "id",
+ "version",
+ "description",
+ "origin",
+ "permissions",
+ "featuresRepo",
+ "features",
+ "requiredApps",
+ "state"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "example": "org.onosproject.distributedprimitives"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "version": {
+ "type": "string",
+ "example": "1.4.0.SNAPSHOT"
+ },
+ "description": {
+ "type": "string",
+ "example": "ONOS app to test distributed primitives"
+ },
+ "origin": {
+ "type": "string",
+ "example": "ON.Lab"
+ },
+ "permissions": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "featuresRepo": {
+ "type": "string",
+ "example": "mvn:org.onosproject/onos-app-cip/1.4.0-SNAPSHOT/xml/features"
+ },
+ "features": {
+ "type": "array",
+ "xml": {
+ "name": "features",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "onos-app-distributed-primitives"
+ }
+ },
+ "requiredApps": {
+ "type": "array",
+ "xml": {
+ "name": "requiredApps",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": ""
+ }
+ },
+ "state": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Cluster.json b/framework/src/onos/web/api/src/main/resources/definitions/Cluster.json
new file mode 100644
index 00000000..f2d32a84
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Cluster.json
@@ -0,0 +1,45 @@
+{
+ "type": "object",
+ "title": "cluster",
+ "required": [
+ "nodes"
+ ],
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "xml": {
+ "name": "nodes",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "nodes",
+ "required": [
+ "id",
+ "ip",
+ "tcpPort",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "ip": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "tcpPort": {
+ "type": "integer",
+ "format": "int64",
+ "example": 9876
+ },
+ "status": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/ClusterNode.json b/framework/src/onos/web/api/src/main/resources/definitions/ClusterNode.json
new file mode 100644
index 00000000..831f02f1
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/ClusterNode.json
@@ -0,0 +1,28 @@
+{
+ "type": "object",
+ "required": [
+ "id",
+ "ip",
+ "tcpPort",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "ip": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "tcpPort": {
+ "type": "integer",
+ "format": "int64",
+ "example": 9876
+ },
+ "status": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/ClusterPost.json b/framework/src/onos/web/api/src/main/resources/definitions/ClusterPost.json
new file mode 100644
index 00000000..ad67fc7b
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/ClusterPost.json
@@ -0,0 +1,42 @@
+{
+ "type": "object",
+ "title": "nodes",
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "xml": {
+ "name": "nodes",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "nodes",
+ "required": [
+ "id",
+ "ip",
+ "tcpPort",
+ "status"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "ip": {
+ "type": "string",
+ "example": "127.0.0.1"
+ },
+ "tcpPort": {
+ "type": "integer",
+ "format": "int64",
+ "example": 9876
+ },
+ "status": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/DeviceGet.json b/framework/src/onos/web/api/src/main/resources/definitions/DeviceGet.json
new file mode 100644
index 00000000..03e67d5f
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/DeviceGet.json
@@ -0,0 +1,77 @@
+{
+ "type": "object",
+ "title": "device",
+ "required": [
+ "id",
+ "type",
+ "available",
+ "role",
+ "mfr",
+ "hw",
+ "sw",
+ "serial",
+ "chassisId",
+ "annotations"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "type": {
+ "type": "string",
+ "example": "SWITCH"
+ },
+ "available": {
+ "type": "boolean",
+ "example": true
+ },
+ "role": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "mfr": {
+ "type": "string",
+ "example": "Nicira, Inc."
+ },
+ "hw": {
+ "type": "string",
+ "example": "Open vSwitch"
+ },
+ "sw": {
+ "type": "string",
+ "example": "2.3.1"
+ },
+ "serial": {
+ "type": "string",
+ "example": "123"
+ },
+ "chassisId": {
+ "type": "string",
+ "example": "1"
+ },
+ "annotations": {
+ "type": "object",
+ "title": "annotations",
+ "required": [
+ "managementAddress",
+ "protocol",
+ "channelId"
+ ],
+ "properties": {
+ "managementAddress": {
+ "type": "string",
+ "example": "123"
+ },
+ "protocol": {
+ "type": "string",
+ "example": "OF_13"
+ },
+ "channelId": {
+ "type": "string",
+ "example": "10.128.12.4:34689"
+ }
+ }
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/DeviceGetPorts.json b/framework/src/onos/web/api/src/main/resources/definitions/DeviceGetPorts.json
new file mode 100644
index 00000000..3a5230ca
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/DeviceGetPorts.json
@@ -0,0 +1,132 @@
+{
+ "type": "object",
+ "title": "device",
+ "required": [
+ "id",
+ "type",
+ "available",
+ "role",
+ "mfr",
+ "hw",
+ "sw",
+ "serial",
+ "chassisId",
+ "annotations"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "type": {
+ "type": "string",
+ "example": "SWITCH"
+ },
+ "available": {
+ "type": "boolean",
+ "example": true
+ },
+ "role": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "mfr": {
+ "type": "string",
+ "example": "Nicira, Inc."
+ },
+ "hw": {
+ "type": "string",
+ "example": "Open vSwitch"
+ },
+ "sw": {
+ "type": "string",
+ "example": "2.3.1"
+ },
+ "serial": {
+ "type": "string",
+ "example": "123"
+ },
+ "chassisId": {
+ "type": "string",
+ "example": "1"
+ },
+ "annotations": {
+ "type": "object",
+ "title": "annotations",
+ "required": [
+ "managementAddress",
+ "protocol",
+ "channelId"
+ ],
+ "properties": {
+ "managementAddress": {
+ "type": "string",
+ "example": "123"
+ },
+ "protocol": {
+ "type": "string",
+ "example": "OF_13"
+ },
+ "channelId": {
+ "type": "string",
+ "example": "10.128.12.4:34689"
+ }
+ }
+ },
+ "ports": {
+ "type": "array",
+ "xml": {
+ "name": "port",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "port",
+ "required": [
+ "element",
+ "port",
+ "isEnabled",
+ "type",
+ "portSpeed",
+ "annotations"
+ ],
+ "properties": {
+ "element": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "port": {
+ "type": "string",
+ "example": "2"
+ },
+ "isEnabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "type": {
+ "type": "string",
+ "example": "copper"
+ },
+ "portSpeed": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "annotations": {
+ "type": "object",
+ "title": "annotations",
+ "required": [
+ "portName"
+ ],
+ "properties": {
+ "portName": {
+ "type": "string",
+ "example": "s1"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/DevicesGet.json b/framework/src/onos/web/api/src/main/resources/definitions/DevicesGet.json
new file mode 100644
index 00000000..4cf4d9d2
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/DevicesGet.json
@@ -0,0 +1,93 @@
+{
+ "type": "object",
+ "title": "nodes",
+ "required": [
+ "devices"
+ ],
+ "properties": {
+ "devices": {
+ "type": "array",
+ "xml": {
+ "name": "device",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "device",
+ "required": [
+ "id",
+ "type",
+ "available",
+ "role",
+ "mfr",
+ "hw",
+ "sw",
+ "serial",
+ "chassisId",
+ "annotations"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "type": {
+ "type": "string",
+ "example": "SWITCH"
+ },
+ "available": {
+ "type": "boolean",
+ "example": true
+ },
+ "role": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "mfr": {
+ "type": "string",
+ "example": "Nicira, Inc."
+ },
+ "hw": {
+ "type": "string",
+ "example": "Open vSwitch"
+ },
+ "sw": {
+ "type": "string",
+ "example": "2.3.1"
+ },
+ "serial": {
+ "type": "string",
+ "example": "123"
+ },
+ "chassisId": {
+ "type": "string",
+ "example": "1"
+ },
+ "annotations": {
+ "type": "object",
+ "title": "annotations",
+ "required": [
+ "managementAddress",
+ "protocol",
+ "channelId"
+ ],
+ "properties": {
+ "managementAddress": {
+ "type": "string",
+ "example": "123"
+ },
+ "protocol": {
+ "type": "string",
+ "example": "OF_13"
+ },
+ "channelId": {
+ "type": "string",
+ "example": "10.128.12.4:34689"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Flows.json b/framework/src/onos/web/api/src/main/resources/definitions/Flows.json
new file mode 100644
index 00000000..7428d73b
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Flows.json
@@ -0,0 +1,179 @@
+{
+ "type": "object",
+ "title": "flows",
+ "required": [
+ "flows"
+ ],
+ "properties": {
+ "flows": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "flow",
+ "required": [
+ "id",
+ "tableId",
+ "appId",
+ "groupId",
+ "priority",
+ "timeout",
+ "isPermanent",
+ "deviceId",
+ "state",
+ "life",
+ "packets",
+ "bytes",
+ "lastSeen"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "12103425214920339"
+ },
+ "tableId": {
+ "type": "integer",
+ "format": "int64",
+ "example": 3
+ },
+ "appId": {
+ "type": "string",
+ "example": "org.onosproject.core"
+ },
+ "groupId": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "priority": {
+ "type": "integer",
+ "format": "int64",
+ "example": 400000
+ },
+ "timeout": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "isPermanent": {
+ "type": "boolean",
+ "example": true
+ },
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000003"
+ },
+ "state": {
+ "type": "string",
+ "example": "ADDED"
+ },
+ "life": {
+ "type": "integer",
+ "format": "int64",
+ "example": 69889
+ },
+ "packets": {
+ "type": "integer",
+ "format": "int64",
+ "example": 22546
+ },
+ "bytes": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1826226
+ },
+ "lastSeen": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1447892365670
+ },
+ "treatment": {
+ "type": "object",
+ "title": "treatment",
+ "required": [
+ "instructions",
+ "deferred"
+ ],
+ "properties": {
+ "instructions": {
+ "type": "array",
+ "title": "treatment",
+ "required": [
+ "properties",
+ "port"
+ ],
+ "items": {
+ "type": "object",
+ "title": "instruction",
+ "required": [
+ "type",
+ "port"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "OUTPUT"
+ },
+ "port": {
+ "type": "integer",
+ "format": "int64",
+ "example": -3
+ }
+ }
+ }
+ },
+ "deferred": {
+ "type": "array",
+ "xml": {
+ "name": "deferred",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "selector": {
+ "type": "object",
+ "title": "selector",
+ "required": [
+ "criteria"
+ ],
+ "properties": {
+ "criteria": {
+ "type": "array",
+ "xml": {
+ "name": "criteria",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "criteria",
+ "required": [
+ "type",
+ "ethType"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "ETH_TYPE"
+ },
+ "ethType": {
+ "type": "integer",
+ "format": "int64",
+ "example": "0x88cc"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/FlowsPost.json b/framework/src/onos/web/api/src/main/resources/definitions/FlowsPost.json
new file mode 100644
index 00000000..11738da6
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/FlowsPost.json
@@ -0,0 +1,102 @@
+{
+ "type": "object",
+ "title": "flow",
+ "required": [
+ "priority",
+ "timeout",
+ "isPermanent",
+ "deviceId"
+ ],
+ "properties": {
+ "priority": {
+ "type": "integer",
+ "format": "int64",
+ "example": 400000
+ },
+ "timeout": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "isPermanent": {
+ "type": "boolean",
+ "example": true
+ },
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "treatment": {
+ "type": "object",
+ "title": "treatment",
+ "required": [
+ "instructions",
+ "deferred"
+ ],
+ "properties": {
+ "instructions": {
+ "type": "array",
+ "title": "treatment",
+ "required": [
+ "properties",
+ "port"
+ ],
+ "items": {
+ "type": "object",
+ "title": "instructions",
+ "required": [
+ "type",
+ "port"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "OUTPUT"
+ },
+ "port": {
+ "type": "integer",
+ "format": "int64",
+ "example": -3
+ }
+ }
+ }
+ }
+ }
+ },
+ "selector": {
+ "type": "object",
+ "title": "selector",
+ "required": [
+ "criteria"
+ ],
+ "properties": {
+ "criteria": {
+ "type": "array",
+ "xml": {
+ "name": "criteria",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "criteria",
+ "required": [
+ "type",
+ "ethType"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "ETH_TYPE"
+ },
+ "ethType": {
+ "type": "integer",
+ "format": "int64",
+ "example": "0x88cc"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Host.json b/framework/src/onos/web/api/src/main/resources/definitions/Host.json
new file mode 100644
index 00000000..208bf1f5
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Host.json
@@ -0,0 +1,54 @@
+{
+ "type": "object",
+ "title": "host",
+ "required": [
+ "id",
+ "mac",
+ "vlan",
+ "ipAddresses",
+ "location"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8/-1"
+ },
+ "mac": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8"
+ },
+ "vlan": {
+ "type": "string",
+ "example": "-1"
+ },
+ "ipAddresses": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "127.0.0.1"
+ }
+ },
+ "location": {
+ "type": "object",
+ "title": "location",
+ "required": [
+ "elementId",
+ "port"
+ ],
+ "properties": {
+ "elementId": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ },
+ "port": {
+ "type": "string",
+ "example": "3"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/HostPut.json b/framework/src/onos/web/api/src/main/resources/definitions/HostPut.json
new file mode 100644
index 00000000..66bf6545
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/HostPut.json
@@ -0,0 +1,49 @@
+{
+ "type": "object",
+ "title": "host",
+ "required": [
+ "mac",
+ "vlan",
+ "ipAddresses",
+ "location"
+ ],
+ "properties": {
+ "mac": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8"
+ },
+ "vlan": {
+ "type": "string",
+ "example": "-1"
+ },
+ "ipAddresses": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "127.0.0.1"
+ }
+ },
+ "location": {
+ "type": "object",
+ "title": "location",
+ "required": [
+ "elementId",
+ "port"
+ ],
+ "properties": {
+ "elementId": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ },
+ "port": {
+ "type": "string",
+ "example": "3"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Hosts.json b/framework/src/onos/web/api/src/main/resources/definitions/Hosts.json
new file mode 100644
index 00000000..235a0833
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Hosts.json
@@ -0,0 +1,70 @@
+{
+ "type": "object",
+ "title": "hosts",
+ "required": [
+ "hosts"
+ ],
+ "properties": {
+ "hosts": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "host",
+ "required": [
+ "id",
+ "mac",
+ "vlan",
+ "ipAddresses",
+ "location"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8/-1"
+ },
+ "mac": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8"
+ },
+ "vlan": {
+ "type": "string",
+ "example": "-1"
+ },
+ "ipAddresses": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "127.0.0.1"
+ }
+ },
+ "location": {
+ "type": "object",
+ "title": "location",
+ "required": [
+ "elementId",
+ "port"
+ ],
+ "properties": {
+ "elementId": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ },
+ "port": {
+ "type": "string",
+ "example": "3"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/IntentHost.json b/framework/src/onos/web/api/src/main/resources/definitions/IntentHost.json
new file mode 100644
index 00000000..67c181c0
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/IntentHost.json
@@ -0,0 +1,34 @@
+{
+ "type": "object",
+ "title": "host",
+ "required": [
+ "type",
+ "appId",
+ "priority",
+ "one",
+ "two"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "HostToHostIntent"
+ },
+ "appId": {
+ "type": "string",
+ "example": "org.onosproject.ovsdb"
+ },
+ "priority": {
+ "type": "integer",
+ "format": "int64",
+ "example": 55
+ },
+ "one": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8/-1"
+ },
+ "two": {
+ "type": "string",
+ "example": "08:00:27:56:8a:15/-1"
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/IntentPoint.json b/framework/src/onos/web/api/src/main/resources/definitions/IntentPoint.json
new file mode 100644
index 00000000..b84ad987
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/IntentPoint.json
@@ -0,0 +1,62 @@
+{
+ "type": "object",
+ "title": "host",
+ "required": [
+ "type",
+ "appId",
+ "priority",
+ "ingressPoint",
+ "egressPoint"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "PointToPointIntent"
+ },
+ "appId": {
+ "type": "string",
+ "example": "org.onosproject.ovsdb"
+ },
+ "priority": {
+ "type": "integer",
+ "format": "int64",
+ "example": 55
+ },
+ "ingressPoint": {
+ "type": "object",
+ "title": "point",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "3"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ }
+ }
+ },
+ "egressPoint": {
+ "type": "object",
+ "title": "point",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "2"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000003"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Intents.json b/framework/src/onos/web/api/src/main/resources/definitions/Intents.json
new file mode 100644
index 00000000..f32ef07b
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Intents.json
@@ -0,0 +1,60 @@
+{
+ "type": "object",
+ "title": "intents",
+ "required": [
+ "intents"
+ ],
+ "properties": {
+ "intents": {
+ "type": "array",
+ "xml": {
+ "name": "intents",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "host",
+ "required": [
+ "type",
+ "id",
+ "appId",
+ "state"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "HostToHostIntent"
+ },
+ "id": {
+ "type": "string",
+ "example": "0x6"
+ },
+ "appId": {
+ "type": "string",
+ "example": "org.onosproject.ovsdb"
+ },
+ "priority": {
+ "type": "integer",
+ "format": "int64",
+ "example": 55
+ },
+ "resources": {
+ "type": "array",
+ "xml": {
+ "name": "resources",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "example": "46:E4:3C:A4:17:C8/-1"
+ },
+ "state": {
+ "type": "string",
+ "example": "INSTALLED"
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/LinksGet.json b/framework/src/onos/web/api/src/main/resources/definitions/LinksGet.json
new file mode 100644
index 00000000..367cb67e
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/LinksGet.json
@@ -0,0 +1,72 @@
+{
+ "type": "object",
+ "title": "links",
+ "required": [
+ "links"
+ ],
+ "properties": {
+ "links": {
+ "type": "array",
+ "xml": {
+ "name": "links",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "link",
+ "required": [
+ "src",
+ "dst",
+ "type",
+ "state"
+ ],
+ "properties": {
+ "src": {
+ "type": "object",
+ "title": "src",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "3"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ }
+ }
+ },
+ "dst": {
+ "type": "object",
+ "title": "dst",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "2"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000003"
+ }
+ }
+ },
+ "type": {
+ "type": "string",
+ "example": "DIRECT"
+ },
+ "state": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/NetCfgGet.json b/framework/src/onos/web/api/src/main/resources/definitions/NetCfgGet.json
new file mode 100644
index 00000000..0fdcf585
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/NetCfgGet.json
@@ -0,0 +1,93 @@
+{
+ "type": "object",
+ "required": [
+ "apps",
+ "links",
+ "domains",
+ "hosts",
+ "ports",
+ "devices"
+ ],
+ "properties": {
+ "apps": {
+ "type": "object"
+ },
+ "links": {
+ "title": "links",
+ "type": "object",
+ "properties": {
+ "deviceId/port-deviceId/port": {
+ "title": "basic",
+ "type": "object",
+ "required": [
+ "basic"
+ ],
+ "properties": {
+ "basic": {
+ "title": "basic",
+ "type": "object",
+ "properties": {
+ "allowed": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "domains": {
+ "type": "object"
+ },
+ "hosts": {
+ "type": "object"
+ },
+ "ports": {
+ "type": "object"
+ },
+ "devices": {
+ "title": "Devices",
+ "type": "object",
+ "required": [
+ "deviceId"
+ ],
+ "properties": {
+ "deviceId": {
+ "title": "basic",
+ "type": "object",
+ "required": [
+ "basic"
+ ],
+ "properties": {
+ "basic": {
+ "title": "basicDevice",
+ "type": "object",
+ "required": [
+ "allowed"
+ ],
+ "properties": {
+ "allowed": {
+ "type": "boolean",
+ "example": true
+ },
+ "name": {
+ "type": "string",
+ "example": "DeviceName"
+ },
+ "owner": {
+ "type": "string",
+ "example": "OwnerName"
+ },
+ "latitude": {
+ "type": "string",
+ "example": "25"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Paths.json b/framework/src/onos/web/api/src/main/resources/definitions/Paths.json
new file mode 100644
index 00000000..2407036e
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Paths.json
@@ -0,0 +1,94 @@
+{
+ "type": "object",
+ "title": "paths",
+ "required": [
+ "paths"
+ ],
+ "properties": {
+ "paths": {
+ "type": "array",
+ "xml": {
+ "name": "hosts",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "host",
+ "required": [
+ "cost",
+ "links"
+ ],
+ "properties": {
+ "cost": {
+ "type": "integer",
+ "format": "int64",
+ "example": 2
+ },
+ "links": {
+ "type": "array",
+ "xml": {
+ "name": "links",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "link",
+ "required": [
+ "src",
+ "dst",
+ "type",
+ "state"
+ ],
+ "properties": {
+ "src": {
+ "type": "object",
+ "title": "src",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "3"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000002"
+ }
+ }
+ },
+ "dst": {
+ "type": "object",
+ "title": "dst",
+ "required": [
+ "port",
+ "device"
+ ],
+ "properties": {
+ "port": {
+ "type": "string",
+ "example": "2"
+ },
+ "device": {
+ "type": "string",
+ "example": "of:0000000000000003"
+ }
+ }
+ },
+ "type": {
+ "type": "string",
+ "example": "DIRECT"
+ },
+ "state": {
+ "type": "string",
+ "example": "ACTIVE"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsLink.json b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsLink.json
new file mode 100644
index 00000000..886902b8
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsLink.json
@@ -0,0 +1,54 @@
+{
+ "type": "object",
+ "title": "loads",
+ "required": [
+ "loads"
+ ],
+ "properties": {
+ "loads": {
+ "type": "array",
+ "required": [
+ "loads"
+ ],
+ "xml": {
+ "name": "loads",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "loads",
+ "required": [
+ "rate",
+ "latest",
+ "valid",
+ "time",
+ "link"
+ ],
+ "properties": {
+ "rate": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "latest": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "valid": {
+ "type": "boolean",
+ "example": false
+ },
+ "time": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1447980119542
+ },
+ "link": {
+ "type": "string",
+ "example": "http://10.128.12.1:8181/onos/v1/links?device=of:0000000000000002&port=3"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsTables.json b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsTables.json
new file mode 100644
index 00000000..77668734
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsTables.json
@@ -0,0 +1,76 @@
+{
+ "type": "object",
+ "title": "statistics",
+ "required": [
+ "statistics"
+ ],
+ "properties": {
+ "statistics": {
+ "type": "array",
+ "required": [
+ "statistics"
+ ],
+ "xml": {
+ "name": "statistics",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "statistics",
+ "required": [
+ "table"
+ ],
+ "properties": {
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "table": {
+ "type": "array",
+ "xml": {
+ "name": "table",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "tables",
+ "required": [
+ "tableId",
+ "deviceId",
+ "activeEntries",
+ "packetsLookedUp",
+ "packetsMathced"
+ ],
+ "properties": {
+ "tableId": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "activeEntries": {
+ "type": "integer",
+ "format": "int64",
+ "example": 3
+ },
+ "packetsLookedUp": {
+ "type": "integer",
+ "format": "int64",
+ "example": 458530
+ },
+ "packetsMathced": {
+ "type": "integer",
+ "format": "int64",
+ "example": 458501
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/StatisticsPorts.json b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsPorts.json
new file mode 100644
index 00000000..e3ed71f1
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/StatisticsPorts.json
@@ -0,0 +1,107 @@
+{
+ "type": "object",
+ "title": "all-port-statistics",
+ "required": [
+ "statistics"
+ ],
+ "properties": {
+ "statistics": {
+ "type": "array",
+ "required": [
+ "statistics"
+ ],
+ "xml": {
+ "name": "statistics",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "statistics",
+ "required": [
+ "ports"
+ ],
+ "properties": {
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "ports": {
+ "type": "array",
+ "xml": {
+ "name": "ports",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "ports",
+ "required": [
+ "port",
+ "packetsReceived",
+ "packetsSent",
+ "bytesReceived",
+ "bytesSent",
+ "packetsRxDropped",
+ "packetsTxDropped",
+ "packetsRxErrors",
+ "packetsTxErrors",
+ "durationSec"
+ ],
+ "properties": {
+ "port": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "packetsReceived": {
+ "type": "integer",
+ "format": "int64",
+ "example": 98
+ },
+ "packetsSent": {
+ "type": "integer",
+ "format": "int64",
+ "example": 98
+ },
+ "bytesReceived": {
+ "type": "integer",
+ "format": "int64",
+ "example": 9162
+ },
+ "bytesSent": {
+ "type": "integer",
+ "format": "int64",
+ "example": 9162
+ },
+ "packetsRxDropped": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "packetsTxDropped": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "packetsRxErrors": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "packetsTxErrors": {
+ "type": "integer",
+ "format": "int64",
+ "example": 0
+ },
+ "durationSec": {
+ "type": "integer",
+ "format": "int64",
+ "example": 90
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/Topology.json b/framework/src/onos/web/api/src/main/resources/definitions/Topology.json
new file mode 100644
index 00000000..5e38d323
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/Topology.json
@@ -0,0 +1,32 @@
+{
+ "type": "object",
+ "title": "topology",
+ "required": [
+ "time",
+ "devices",
+ "links",
+ "clusters"
+ ],
+ "properties": {
+ "time": {
+ "type": "integer",
+ "format": "int64",
+ "example": 183004405835967
+ },
+ "devices": {
+ "type": "integer",
+ "format": "int64",
+ "example": 3
+ },
+ "links": {
+ "type": "integer",
+ "format": "int64",
+ "example": 4
+ },
+ "clusters": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/TopologyBroadcast.json b/framework/src/onos/web/api/src/main/resources/definitions/TopologyBroadcast.json
new file mode 100644
index 00000000..52488534
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/TopologyBroadcast.json
@@ -0,0 +1,13 @@
+{
+ "type": "object",
+ "title": "response",
+ "required": [
+ "broadcast"
+ ],
+ "properties": {
+ "broadcast": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/TopologyCluster.json b/framework/src/onos/web/api/src/main/resources/definitions/TopologyCluster.json
new file mode 100644
index 00000000..8adf2dea
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/TopologyCluster.json
@@ -0,0 +1,31 @@
+{
+ "type": "object",
+ "title": "device",
+ "required": [
+ "id",
+ "deviceCount",
+ "linkCount",
+ "root"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "deviceCount": {
+ "type": "integer",
+ "format": "int64",
+ "example": 3
+ },
+ "linkCount": {
+ "type": "integer",
+ "format": "int64",
+ "example": 4
+ },
+ "root": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ }
+ }
+}
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/TopologyClusters.json b/framework/src/onos/web/api/src/main/resources/definitions/TopologyClusters.json
new file mode 100644
index 00000000..5974b445
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/TopologyClusters.json
@@ -0,0 +1,48 @@
+{
+ "type": "object",
+ "title": "clusters",
+ "required": [
+ "clusters"
+ ],
+ "properties": {
+ "clusters": {
+ "type": "array",
+ "xml": {
+ "name": "cluster",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "cluster",
+ "required": [
+ "id",
+ "deviceCount",
+ "linkCount",
+ "root"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "example": 1
+ },
+ "deviceCount": {
+ "type": "integer",
+ "format": "int64",
+ "example": 3
+ },
+ "linkCount": {
+ "type": "integer",
+ "format": "int64",
+ "example": 4
+ },
+ "root": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/TopologyClustersDevices.json b/framework/src/onos/web/api/src/main/resources/definitions/TopologyClustersDevices.json
new file mode 100644
index 00000000..6077d9d7
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/TopologyClustersDevices.json
@@ -0,0 +1,22 @@
+{
+ "type": "object",
+ "title": "devices",
+ "required": [
+ "devices"
+ ],
+ "properties": {
+ "devices": {
+ "type": "array",
+ "xml": {
+ "name": "cluster",
+ "wrapped": true
+ },
+ "items": {
+ "type": "string",
+ "title": "device",
+ "example": "of:0000000000000001"
+ }
+ }
+ }
+}
+
diff --git a/framework/src/onos/web/api/src/main/resources/definitions/TopologyInfrastructure.json b/framework/src/onos/web/api/src/main/resources/definitions/TopologyInfrastructure.json
new file mode 100644
index 00000000..64564c00
--- /dev/null
+++ b/framework/src/onos/web/api/src/main/resources/definitions/TopologyInfrastructure.json
@@ -0,0 +1,13 @@
+{
+ "type": "object",
+ "title": "response",
+ "required": [
+ "infrastructure"
+ ],
+ "properties": {
+ "infrastructure": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/web/api/src/test/resources/org/onosproject/rest/post-flow.json b/framework/src/onos/web/api/src/test/resources/org/onosproject/rest/post-flow.json
index 939b4478..154ef671 100644
--- a/framework/src/onos/web/api/src/test/resources/org/onosproject/rest/post-flow.json
+++ b/framework/src/onos/web/api/src/test/resources/org/onosproject/rest/post-flow.json
@@ -13,7 +13,7 @@
"criteria": [
{
"type": "ETH_TYPE",
- "ethType": 2054
+ "ethType": "0x806"
}
]
}
diff --git a/framework/src/onos/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java b/framework/src/onos/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
index 1b6f7f99..1d49d028 100644
--- a/framework/src/onos/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
+++ b/framework/src/onos/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
@@ -103,7 +103,7 @@ public class UiWebSocket
}
@Override
- public void onOpen(Connection connection) {
+ public synchronized void onOpen(Connection connection) {
this.connection = connection;
this.control = (FrameConnection) connection;
try {