Committed by
Gerrit Code Review
[ONOS-3394] Json Models for Intents
Change-Id: I33620d826fddffa69982d49cb99fe4199c2bf522
Showing
5 changed files
with
133 additions
and
51 deletions
| ... | @@ -114,6 +114,8 @@ public final class HostToHostIntent extends ConnectivityIntent { | ... | @@ -114,6 +114,8 @@ public final class HostToHostIntent extends ConnectivityIntent { |
| 114 | return this; | 114 | return this; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | + | ||
| 118 | + | ||
| 117 | /** | 119 | /** |
| 118 | * Builds a host to host intent from the accumulated parameters. | 120 | * Builds a host to host intent from the accumulated parameters. |
| 119 | * | 121 | * | ... | ... |
| ... | @@ -70,7 +70,7 @@ public class IntentsWebResource extends AbstractWebResource { | ... | @@ -70,7 +70,7 @@ public class IntentsWebResource extends AbstractWebResource { |
| 70 | /** | 70 | /** |
| 71 | * Get all intents. | 71 | * Get all intents. |
| 72 | * Returns array containing all the intents in the system. | 72 | * Returns array containing all the intents in the system. |
| 73 | - * | 73 | + * @rsModel Intents |
| 74 | * @return array of all the intents in the system | 74 | * @return array of all the intents in the system |
| 75 | */ | 75 | */ |
| 76 | @GET | 76 | @GET |
| ... | @@ -84,7 +84,7 @@ public class IntentsWebResource extends AbstractWebResource { | ... | @@ -84,7 +84,7 @@ public class IntentsWebResource extends AbstractWebResource { |
| 84 | /** | 84 | /** |
| 85 | * Get intent by application and key. | 85 | * Get intent by application and key. |
| 86 | * Returns details of the specified intent. | 86 | * Returns details of the specified intent. |
| 87 | - * | 87 | + * @rsModel Intents |
| 88 | * @param appId application identifier | 88 | * @param appId application identifier |
| 89 | * @param key intent key | 89 | * @param key intent key |
| 90 | * @return intent data | 90 | * @return intent data |
| ... | @@ -136,7 +136,7 @@ public class IntentsWebResource extends AbstractWebResource { | ... | @@ -136,7 +136,7 @@ public class IntentsWebResource extends AbstractWebResource { |
| 136 | /** | 136 | /** |
| 137 | * Submit a new intent. | 137 | * Submit a new intent. |
| 138 | * Creates and submits intent from the JSON request. | 138 | * Creates and submits intent from the JSON request. |
| 139 | - * | 139 | + * @rsModel IntentHost |
| 140 | * @param stream input JSON | 140 | * @param stream input JSON |
| 141 | * @return status of the request - CREATED if the JSON is correct, | 141 | * @return status of the request - CREATED if the JSON is correct, |
| 142 | * BAD_REQUEST if the JSON is invalid | 142 | * BAD_REQUEST if the JSON is invalid | ... | ... |
| 1 | +{ | ||
| 2 | + "type": "object", | ||
| 3 | + "title": "host", | ||
| 4 | + "required": [ | ||
| 5 | + "type", | ||
| 6 | + "appId", | ||
| 7 | + "priority", | ||
| 8 | + "one", | ||
| 9 | + "two" | ||
| 10 | + ], | ||
| 11 | + "properties": { | ||
| 12 | + "type": { | ||
| 13 | + "type": "string", | ||
| 14 | + "example": "HostToHostIntent" | ||
| 15 | + }, | ||
| 16 | + "appId": { | ||
| 17 | + "type": "string", | ||
| 18 | + "example": "org.onosproject.ovsdb" | ||
| 19 | + }, | ||
| 20 | + "priority": { | ||
| 21 | + "type": "integer", | ||
| 22 | + "format": "int64", | ||
| 23 | + "example": 55 | ||
| 24 | + }, | ||
| 25 | + "one": { | ||
| 26 | + "type": "string", | ||
| 27 | + "example": "46:E4:3C:A4:17:C8/-1" | ||
| 28 | + }, | ||
| 29 | + "two": { | ||
| 30 | + "type": "string", | ||
| 31 | + "example": "08:00:27:56:8a:15/-1" | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +{ | ||
| 2 | + "type": "object", | ||
| 3 | + "title": "host", | ||
| 4 | + "required": [ | ||
| 5 | + "type", | ||
| 6 | + "appId", | ||
| 7 | + "priority", | ||
| 8 | + "ingressPoint", | ||
| 9 | + "egressPoint" | ||
| 10 | + ], | ||
| 11 | + "properties": { | ||
| 12 | + "type": { | ||
| 13 | + "type": "string", | ||
| 14 | + "example": "PointToPointIntent" | ||
| 15 | + }, | ||
| 16 | + "appId": { | ||
| 17 | + "type": "string", | ||
| 18 | + "example": "org.onosproject.ovsdb" | ||
| 19 | + }, | ||
| 20 | + "priority": { | ||
| 21 | + "type": "integer", | ||
| 22 | + "format": "int64", | ||
| 23 | + "example": 55 | ||
| 24 | + }, | ||
| 25 | + "ingressPoint": { | ||
| 26 | + "type": "object", | ||
| 27 | + "title": "point", | ||
| 28 | + "required": [ | ||
| 29 | + "port", | ||
| 30 | + "device" | ||
| 31 | + ], | ||
| 32 | + "properties": { | ||
| 33 | + "port": { | ||
| 34 | + "type": "string", | ||
| 35 | + "example": "3" | ||
| 36 | + }, | ||
| 37 | + "device": { | ||
| 38 | + "type": "string", | ||
| 39 | + "example": "of:0000000000000002" | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + }, | ||
| 43 | + "egressPoint": { | ||
| 44 | + "type": "object", | ||
| 45 | + "title": "point", | ||
| 46 | + "required": [ | ||
| 47 | + "port", | ||
| 48 | + "device" | ||
| 49 | + ], | ||
| 50 | + "properties": { | ||
| 51 | + "port": { | ||
| 52 | + "type": "string", | ||
| 53 | + "example": "2" | ||
| 54 | + }, | ||
| 55 | + "device": { | ||
| 56 | + "type": "string", | ||
| 57 | + "example": "of:0000000000000003" | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | { | 1 | { |
| 2 | "type": "object", | 2 | "type": "object", |
| 3 | - "title": "device-table-statistics", | 3 | + "title": "intents", |
| 4 | "required": [ | 4 | "required": [ |
| 5 | - "table-statistics" | 5 | + "intents" |
| 6 | ], | 6 | ], |
| 7 | "properties": { | 7 | "properties": { |
| 8 | - "device-table-statistics": { | 8 | + "intents": { |
| 9 | "type": "array", | 9 | "type": "array", |
| 10 | - "required": [ | ||
| 11 | - "device-table-statistics" | ||
| 12 | - ], | ||
| 13 | "xml": { | 10 | "xml": { |
| 14 | - "name": "table-statistics", | 11 | + "name": "intents", |
| 15 | "wrapped": true | 12 | "wrapped": true |
| 16 | }, | 13 | }, |
| 17 | "items": { | 14 | "items": { |
| 18 | "type": "object", | 15 | "type": "object", |
| 19 | - "title": "table-statistics", | 16 | + "title": "host", |
| 20 | "required": [ | 17 | "required": [ |
| 21 | - "device-table-statistics" | 18 | + "type", |
| 19 | + "id", | ||
| 20 | + "appId", | ||
| 21 | + "state" | ||
| 22 | ], | 22 | ], |
| 23 | "properties": { | 23 | "properties": { |
| 24 | - "deviceId": { | 24 | + "type": { |
| 25 | "type": "string", | 25 | "type": "string", |
| 26 | - "example": "of:0000000000000001" | 26 | + "example": "HostToHostIntent" |
| 27 | }, | 27 | }, |
| 28 | - "table-statistics": { | 28 | + "id": { |
| 29 | + "type": "string", | ||
| 30 | + "example": "0x6" | ||
| 31 | + }, | ||
| 32 | + "appId": { | ||
| 33 | + "type": "string", | ||
| 34 | + "example": "org.onosproject.ovsdb" | ||
| 35 | + }, | ||
| 36 | + "priority": { | ||
| 37 | + "type": "integer", | ||
| 38 | + "format": "int64", | ||
| 39 | + "example": 55 | ||
| 40 | + }, | ||
| 41 | + "resources": { | ||
| 29 | "type": "array", | 42 | "type": "array", |
| 30 | "xml": { | 43 | "xml": { |
| 31 | - "name": "table", | 44 | + "name": "resources", |
| 32 | "wrapped": true | 45 | "wrapped": true |
| 33 | }, | 46 | }, |
| 34 | "items": { | 47 | "items": { |
| 35 | - "type": "object", | 48 | + "type": "string", |
| 36 | - "title": "table-statistics", | 49 | + "example": "46:E4:3C:A4:17:C8/-1" |
| 37 | - "required": [ | 50 | + }, |
| 38 | - "tableId", | 51 | + "state": { |
| 39 | - "deviceId", | 52 | + "type": "string", |
| 40 | - "activeEntries", | 53 | + "example": "INSTALLED" |
| 41 | - "packetsLookedUp", | ||
| 42 | - "packetsMathced" | ||
| 43 | - ], | ||
| 44 | - "properties": { | ||
| 45 | - "tableId": { | ||
| 46 | - "type": "integer", | ||
| 47 | - "format": "int64", | ||
| 48 | - "example": 0 | ||
| 49 | - }, | ||
| 50 | - "deviceId": { | ||
| 51 | - "type": "string", | ||
| 52 | - "example": "of:0000000000000001" | ||
| 53 | - }, | ||
| 54 | - "activeEntries": { | ||
| 55 | - "type": "integer", | ||
| 56 | - "format": "int64", | ||
| 57 | - "example": 3 | ||
| 58 | - }, | ||
| 59 | - "packetsLookedUp": { | ||
| 60 | - "type": "integer", | ||
| 61 | - "format": "int64", | ||
| 62 | - "example": 458530 | ||
| 63 | - }, | ||
| 64 | - "packetsMathced": { | ||
| 65 | - "type": "integer", | ||
| 66 | - "format": "int64", | ||
| 67 | - "example": 458501 | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | } | 54 | } |
| 71 | } | 55 | } |
| 72 | } | 56 | } | ... | ... |
-
Please register or login to post a comment