andrea
Committed by Gerrit Code Review

[ONOS-3394] JsonModels for Swagger UI

Change-Id: I57503b28df517642ab15e2b18f66ad63c15b7b8a
......@@ -68,6 +68,7 @@ public class DhcpWebResource extends AbstractWebResource {
* Get all MAC/IP mappings.
* Shows all MAC/IP mappings held by the DHCP server.
*
* @rsModel DhcpConfigGetMappings
* @return 200 OK
*/
@GET
......@@ -89,6 +90,7 @@ public class DhcpWebResource extends AbstractWebResource {
* Get all available IPs.
* Shows all the IPs in the free pool of the DHCP Server.
*
* @rsModel DhcpConfigGetAvailable
* @return 200 OK
*/
@GET
......
{
"type": "object",
"required": [
"availableIp"
],
"properties": {
"availableIp": {
"type": "array",
"items": {
"type": "string"
},
"example": "[127.0.0.1]"
}
}
}
{
"type": "object",
"required": [
"mappings"
],
"properties": {
"mappings": {
"type": "array",
"items": {
"type": "string"
},
"example": "[]"
}
}
}
......@@ -46,6 +46,7 @@ public class DevicesWebResource extends AbstractWebResource {
* Returns array of all discovered infrastructure devices.
*
* @return 200 OK
* @rsModel DevicesGet
*/
@GET
public Response getDevices() {
......@@ -59,6 +60,7 @@ public class DevicesWebResource extends AbstractWebResource {
*
* @param id device identifier
* @return 200 OK
* @rsModel DeviceGet
*/
@GET
@Path("{id}")
......@@ -89,6 +91,7 @@ public class DevicesWebResource extends AbstractWebResource {
* Get ports of infrastructure device.
* Returns details of the specified infrastructure device.
*
* @rsModel DeviceGetPorts
* @param id device identifier
* @return 200 OK
*/
......
......@@ -40,7 +40,7 @@ public class NetworkConfigWebResource extends AbstractWebResource {
/**
* Get entire network configuration base.
*
* @rsModel NetCfgGet
* @return network configuration JSON
*/
@GET
......@@ -131,6 +131,7 @@ public class NetworkConfigWebResource extends AbstractWebResource {
/**
* Upload bulk network configuration.
*
* @rsModel NetCfgGet
* @param request network configuration JSON rooted at the top node
* @return empty response
* @throws IOException if unable to parse the request
......
{
"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"
}
}
}
}
}
{
"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
{
"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"
}
}
}
}
}
}
{
"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"
}
}
}
}
}
}
}
}
}