andrea
Committed by Gerrit Code Review

[ONOS-3394] Json Models for Intents

Change-Id: I33620d826fddffa69982d49cb99fe4199c2bf522
......@@ -114,6 +114,8 @@ public final class HostToHostIntent extends ConnectivityIntent {
return this;
}
/**
* Builds a host to host intent from the accumulated parameters.
*
......
......@@ -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
......
{
"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
{
"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
{
"type": "object",
"title": "device-table-statistics",
"title": "intents",
"required": [
"table-statistics"
"intents"
],
"properties": {
"device-table-statistics": {
"intents": {
"type": "array",
"required": [
"device-table-statistics"
],
"xml": {
"name": "table-statistics",
"name": "intents",
"wrapped": true
},
"items": {
"type": "object",
"title": "table-statistics",
"title": "host",
"required": [
"device-table-statistics"
"type",
"id",
"appId",
"state"
],
"properties": {
"deviceId": {
"type": {
"type": "string",
"example": "of:0000000000000001"
"example": "HostToHostIntent"
},
"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
"id": {
"type": "string",
"example": "0x6"
},
"deviceId": {
"appId": {
"type": "string",
"example": "of:0000000000000001"
"example": "org.onosproject.ovsdb"
},
"activeEntries": {
"priority": {
"type": "integer",
"format": "int64",
"example": 3
"example": 55
},
"packetsLookedUp": {
"type": "integer",
"format": "int64",
"example": 458530
"resources": {
"type": "array",
"xml": {
"name": "resources",
"wrapped": true
},
"packetsMathced": {
"type": "integer",
"format": "int64",
"example": 458501
}
}
"items": {
"type": "string",
"example": "46:E4:3C:A4:17:C8/-1"
},
"state": {
"type": "string",
"example": "INSTALLED"
}
}
}
......