andrea

[ONOS-3394] Json models for REST api

Change-Id: I69c396ae08d25e83dce31e4d2ec92cd9a28c54f5
Showing 31 changed files with 1464 additions and 89 deletions
......@@ -44,6 +44,7 @@ public class ApplicationsWebResource extends AbstractWebResource {
* Get all installed applications.
* Returns array of all installed applications.
*
* @rsModel Applications
* @return 200 OK
*/
@GET
......@@ -56,7 +57,7 @@ public class ApplicationsWebResource extends AbstractWebResource {
/**
* Get application details.
* Returns details of the specified application.
*
* @rsModel Application
* @param name application name
* @return 200 OK; 404; 401
*/
......
......@@ -49,6 +49,7 @@ public class ClusterWebResource extends AbstractWebResource {
* Returns array of all cluster nodes.
*
* @return 200 OK
* @rsModel Cluster
*/
@GET
public Response getClusterNodes() {
......@@ -62,6 +63,7 @@ public class ClusterWebResource extends AbstractWebResource {
*
* @param id cluster node identifier
* @return 200 OK
* @rsModel ClusterNode
*/
@GET
@Path("{id}")
......@@ -78,6 +80,7 @@ public class ClusterWebResource extends AbstractWebResource {
* @param config cluster definition
* @return 200 OK
* @throws IOException to signify bad request
* @rsModel ClusterPost
*/
@POST
@Path("configuration")
......
......@@ -58,7 +58,7 @@ public class FlowsWebResource extends AbstractWebResource {
/**
* Get all flow entries. Returns array of all flow rules in the system.
*
* @rsModel Flows
* @return array of all the intents in the system
*/
@GET
......@@ -80,7 +80,7 @@ public class FlowsWebResource extends AbstractWebResource {
/**
* Get flow entries of a device. Returns array of all flow rules for the
* specified device.
*
* @rsModel Flows
* @param deviceId device identifier
* @return flow data as an array
*/
......@@ -103,7 +103,7 @@ public class FlowsWebResource extends AbstractWebResource {
/**
* Get flow rule. Returns the flow entry specified by the device id and
* flow rule id.
*
* @rsModel Flows
* @param deviceId device identifier
* @param flowId flow rule identifier
* @return flow data as an array
......@@ -130,7 +130,7 @@ public class FlowsWebResource extends AbstractWebResource {
/**
* Create new flow rule. Creates and installs a new flow rule for the
* specified device.
*
* @rsModel FlowsPost
* @param deviceId device identifier
* @param stream flow rule JSON
* @return status of the request - CREATED if the JSON is correct,
......
......@@ -70,6 +70,7 @@ public class HostsWebResource extends AbstractWebResource {
* Returns array of all known end-station hosts.
*
* @return 200 OK
* @rsModel Hosts
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -85,6 +86,7 @@ public class HostsWebResource extends AbstractWebResource {
*
* @param id host identifier
* @return 200 OK
* @rsModel Host
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -103,6 +105,7 @@ public class HostsWebResource extends AbstractWebResource {
* @param mac host MAC address
* @param vlan host VLAN identifier
* @return 200 OK
* @rsModel Host
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -122,6 +125,7 @@ public class HostsWebResource extends AbstractWebResource {
* @param stream input JSON
* @return status of the request - CREATED if the JSON is correct,
* BAD_REQUEST if the JSON is invalid
* @rsModel HostPut
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
......@@ -195,6 +199,7 @@ 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);
// Update host inventory
......
......@@ -44,7 +44,7 @@ public class LinksWebResource extends AbstractWebResource {
/**
* Get infrastructure links.
* Returns array of all links, or links for the specified device or port.
*
* @rsModel LinksGet
* @param deviceId (optional) device identifier
* @param port (optional) port number
* @param direction (optional) direction qualifier
......
......@@ -60,7 +60,7 @@ public class PathsWebResource extends AbstractWebResource {
/**
* Get all shortest paths between any two hosts or devices.
* Returns array of all shortest paths between any two elements.
*
* @rsModel Paths
* @param src source identifier
* @param dst destination identifier
* @return path data
......@@ -79,7 +79,7 @@ public class PathsWebResource extends AbstractWebResource {
/**
* Get all shortest disjoint paths between any two hosts or devices.
* Returns array of all shortest disjoint paths between any two elements.
*
* @rsModel Paths
* @param src source identifier
* @param dst destination identifier
* @return path data
......
......@@ -59,7 +59,7 @@ public class StatisticsWebResource extends AbstractWebResource {
/**
* Get load statistics for all links or for a specific link.
*
* @rsModel StatisticsFlowsLink
* @param deviceId (optional) device ID for a specific link
* @param port (optional) port number for a specified link
* @return JSON encoded array lof Load objects
......@@ -101,7 +101,7 @@ public class StatisticsWebResource extends AbstractWebResource {
/**
* Get table statistics for all tables of all devices.
*
* @rsModel StatisticsFlowsTables
* @return JSON encoded array of table statistics
*/
@GET
......@@ -111,11 +111,11 @@ public class StatisticsWebResource extends AbstractWebResource {
final FlowRuleService service = get(FlowRuleService.class);
final Iterable<Device> devices = get(DeviceService.class).getDevices();
final ObjectNode root = mapper().createObjectNode();
final ArrayNode rootArrayNode = root.putArray("device-table-statistics");
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("table-statistics");
final ArrayNode statisticsNode = deviceStatsNode.putArray("table");
final Iterable<TableStatisticsEntry> tableStatsEntries = service.getFlowTableStatistics(device.id());
if (tableStatsEntries != null) {
for (final TableStatisticsEntry entry : tableStatsEntries) {
......@@ -130,7 +130,7 @@ public class StatisticsWebResource extends AbstractWebResource {
/**
* Get table statistics for all tables of a specified device.
*
* @rsModel StatisticsFlowsTables
* @param deviceId device ID
* @return JSON encoded array of table statistics
*/
......@@ -142,11 +142,11 @@ public class StatisticsWebResource extends AbstractWebResource {
final Iterable<TableStatisticsEntry> tableStatisticsEntries =
service.getFlowTableStatistics(DeviceId.deviceId(deviceId));
final ObjectNode root = mapper().createObjectNode();
final ArrayNode rootArrayNode = root.putArray("table-statistics");
final ArrayNode rootArrayNode = root.putArray("statistics");
final ObjectNode deviceStatsNode = mapper().createObjectNode();
deviceStatsNode.put("device", deviceId);
final ArrayNode statisticsNode = deviceStatsNode.putArray("table-statistics");
final ArrayNode statisticsNode = deviceStatsNode.putArray("table");
for (final TableStatisticsEntry entry : tableStatisticsEntries) {
statisticsNode.add(codec(TableStatisticsEntry.class).encode(entry, this));
}
......
......@@ -50,6 +50,7 @@ public class TopologyWebResource extends AbstractWebResource {
* Get overview of current topology.
*
* @return topology overview
* @rsModel Topology
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -63,6 +64,7 @@ public class TopologyWebResource extends AbstractWebResource {
* Get overview of topology SCCs.
*
* @return topology clusters overview
* @rsModel TopologyClusters
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -80,6 +82,7 @@ public class TopologyWebResource extends AbstractWebResource {
*
* @param clusterId id of the cluster to query
* @return topology cluster details
* @rsModel TopologyCluster
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -103,6 +106,7 @@ public class TopologyWebResource extends AbstractWebResource {
*
* @param clusterId id of the cluster to query
* @return topology cluster devices
* @rsModel TopologyClustersDevices
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -126,6 +130,7 @@ public class TopologyWebResource extends AbstractWebResource {
*
* @param clusterId id of the cluster to query
* @return topology cluster links
* @rsModel LinksGet
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -136,7 +141,7 @@ public class TopologyWebResource extends AbstractWebResource {
List<Link> links =
Lists.newArrayList(get(TopologyService.class)
.getClusterLinks(topology, cluster));
.getClusterLinks(topology, cluster));
return ok(encodeArray(Link.class, "links", links)).build();
}
......@@ -174,7 +179,8 @@ public class TopologyWebResource extends AbstractWebResource {
*
* @param connectPointString deviceid:portnumber
* @return JSON representation of true if the connect point is broadcast,
* false otherwise
* false otherwise
* @rsModel TopologyBroadcast
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -188,8 +194,8 @@ public class TopologyWebResource extends AbstractWebResource {
boolean isBroadcast = get(TopologyService.class).isBroadcastPoint(topology, connectPoint);
return ok(mapper()
.createObjectNode()
.put("broadcast", isBroadcast))
.createObjectNode()
.put("broadcast", isBroadcast))
.build();
}
......@@ -198,7 +204,8 @@ public class TopologyWebResource extends AbstractWebResource {
*
* @param connectPointString deviceid:portnumber
* @return JSON representation of true if the connect point is broadcast,
* false otherwise
* false otherwise
* @rsModel TopologyInfrastructure
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
......@@ -212,8 +219,8 @@ public class TopologyWebResource extends AbstractWebResource {
boolean isInfrastructure = get(TopologyService.class).isInfrastructure(topology, connectPoint);
return ok(mapper()
.createObjectNode()
.put("infrastructure", isInfrastructure))
.createObjectNode()
.put("infrastructure", isInfrastructure))
.build();
}
......
{
"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
{
"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
{
"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
{
"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
{
"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
{
"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
{
"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": "object",
"title": "nodes",
"required": [
"devices"
],
"properties": {
"devices": {
"type": "array",
"xml": {
"name": "device",
"wrapped": true
},
"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": {
"items": {
"type": "object",
"title": "annotations",
"title": "device",
"required": [
"managementAddress",
"protocol",
"channelId"
"id",
"type",
"available",
"role",
"mfr",
"hw",
"sw",
"serial",
"chassisId",
"annotations"
],
"properties": {
"managementAddress": {
"id": {
"type": "string",
"example": "123"
"example": "of:0000000000000001"
},
"type": {
"type": "string",
"example": "SWITCH"
},
"protocol": {
"available": {
"type": "boolean",
"example": true
},
"role": {
"type": "string",
"example": "of:0000000000000001"
},
"mfr": {
"type": "string",
"example": "OF_13"
"example": "Nicira, Inc."
},
"channelId": {
"hw": {
"type": "string",
"example": "10.128.12.4:34689"
"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"
}
}
}
}
}
......
{
"type": "object",
"title": "flows",
"required": [
"flows"
],
"properties": {
"flows": {
"type": "array",
"xml": {
"name": "hosts",
"wrapped": true
},
"items": {
"type": "object",
"title": "flow",
"required": [
"id",
"appId",
"groupId",
"priority",
"timeout",
"isPermanent",
"deviceId",
"state",
"life",
"packets",
"bytes",
"lastSeen"
],
"properties": {
"id": {
"type": "string",
"example": "12103425214920339"
},
"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": -30516
}
}
}
}
}
}
}
}
\ No newline at end of file
{
"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:0000000000000003"
},
"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": -30516
}
}
}
}
}
}
}
}
\ No newline at end of file
{
"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
{
"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
{
"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
{
"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"
}
}
}
}
}
}
{
"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
{
"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
{
"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
{
"type": "object",
"title": "device-table-statistics",
"required": [
"table-statistics"
],
"properties": {
"device-table-statistics": {
"type": "array",
"required": [
"device-table-statistics"
],
"xml": {
"name": "table-statistics",
"wrapped": true
},
"items": {
"type": "object",
"title": "table-statistics",
"required": [
"device-table-statistics"
],
"properties": {
"deviceId": {
"type": "string",
"example": "of:0000000000000001"
},
"table-statistics": {
"type": "array",
"xml": {
"name": "table",
"wrapped": true
},
"items": {
"type": "object",
"title": "table-statistics",
"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
{
"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
}
}
}
{
"type": "object",
"title": "response",
"required": [
"broadcast"
],
"properties": {
"broadcast": {
"type": "boolean",
"example": true
}
}
}
\ No newline at end of file
{
"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"
}
}
}
{
"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"
}
}
}
}
}
}
{
"type": "object",
"title": "devices",
"required": [
"devices"
],
"properties": {
"devices": {
"type": "array",
"xml": {
"name": "cluster",
"wrapped": true
},
"items": {
"type": "string",
"title": "device",
"example": "of:0000000000000001"
}
}
}
}
{
"type": "object",
"title": "response",
"required": [
"infrastructure"
],
"properties": {
"infrastructure": {
"type": "boolean",
"example": true
}
}
}
\ No newline at end of file