From e63291850fd0795c5700e25e67e5dee89ba54c5f Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Tue, 1 Dec 2015 05:49:27 -0800 Subject: onos commit hash c2999f30c69e50df905a9d175ef80b3f23a98514 Change-Id: I2bb8562c4942b6d6a6d60b663db2e17540477b81 Signed-off-by: Ashlee Young --- .../rest/resources/HostsWebResource.java | 24 ++- .../rest/resources/IntentsWebResource.java | 6 +- .../rest/resources/StatisticsWebResource.java | 59 +++++++ .../main/resources/definitions/Application.json | 80 +++++++++ .../resources/definitions/ApplicationPost.json | 80 +++++++++ .../main/resources/definitions/Applications.json | 96 +++++++++++ .../src/main/resources/definitions/Cluster.json | 45 ++++++ .../main/resources/definitions/ClusterNode.json | 28 ++++ .../main/resources/definitions/ClusterPost.json | 42 +++++ .../src/main/resources/definitions/DeviceGet.json | 77 +++++++++ .../main/resources/definitions/DeviceGetPorts.json | 132 +++++++++++++++ .../src/main/resources/definitions/DevicesGet.json | 93 +++++++++++ .../api/src/main/resources/definitions/Flows.json | 179 +++++++++++++++++++++ .../src/main/resources/definitions/FlowsPost.json | 102 ++++++++++++ .../api/src/main/resources/definitions/Host.json | 54 +++++++ .../src/main/resources/definitions/HostPut.json | 49 ++++++ .../api/src/main/resources/definitions/Hosts.json | 70 ++++++++ .../src/main/resources/definitions/IntentHost.json | 34 ++++ .../main/resources/definitions/IntentPoint.json | 62 +++++++ .../src/main/resources/definitions/Intents.json | 60 +++++++ .../src/main/resources/definitions/LinksGet.json | 72 +++++++++ .../src/main/resources/definitions/NetCfgGet.json | 93 +++++++++++ .../api/src/main/resources/definitions/Paths.json | 94 +++++++++++ .../resources/definitions/StatisticsFlowsLink.json | 54 +++++++ .../definitions/StatisticsFlowsTables.json | 76 +++++++++ .../resources/definitions/StatisticsPorts.json | 107 ++++++++++++ .../src/main/resources/definitions/Topology.json | 32 ++++ .../resources/definitions/TopologyBroadcast.json | 13 ++ .../resources/definitions/TopologyCluster.json | 31 ++++ .../resources/definitions/TopologyClusters.json | 48 ++++++ .../definitions/TopologyClustersDevices.json | 22 +++ .../definitions/TopologyInfrastructure.json | 13 ++ .../resources/org/onosproject/rest/post-flow.json | 2 +- .../java/org/onosproject/ui/impl/UiWebSocket.java | 2 +- 34 files changed, 2024 insertions(+), 7 deletions(-) create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Application.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/ApplicationPost.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Applications.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Cluster.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/ClusterNode.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/ClusterPost.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/DeviceGet.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/DeviceGetPorts.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/DevicesGet.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Flows.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/FlowsPost.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Host.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/HostPut.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Hosts.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/IntentHost.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/IntentPoint.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Intents.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/LinksGet.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/NetCfgGet.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Paths.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsLink.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/StatisticsFlowsTables.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/StatisticsPorts.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/Topology.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/TopologyBroadcast.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/TopologyCluster.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/TopologyClusters.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/TopologyClustersDevices.json create mode 100644 framework/src/onos/web/api/src/main/resources/definitions/TopologyInfrastructure.json (limited to 'framework/src/onos/web') 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); @@ -209,6 +213,22 @@ public class HostsWebResource extends AbstractWebResource { return hostId; } + /** + * 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 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 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 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 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 { -- cgit 1.2.3-korg