Implementation of REST POST API for creating intents
- codec for constraint decode
- codec for intent decode
- POST method for intents
- unit tests for codecs and POST method
Change-Id: Ibc0ef8f99a0c0664710a733985424c77010c49b5
diff --git a/web/api/src/test/resources/org/onosproject/rest/post-intent.json b/web/api/src/test/resources/org/onosproject/rest/post-intent.json
new file mode 100644
index 0000000..4c6c4b8
--- /dev/null
+++ b/web/api/src/test/resources/org/onosproject/rest/post-intent.json
@@ -0,0 +1,38 @@
+{
+ "type": "PointToPointIntent",
+ "appId": 2,
+ "selector": {
+ "criteria": [
+ {
+ "type": "ETH_DST",
+ "mac": "11:22:33:44:55:66"
+ }
+ ]
+ },
+ "treatment": {
+ "instructions": [
+ {
+ "type": "L2MODIFICATION",
+ "subtype": "ETH_SRC",
+ "mac": "22:33:44:55:66:77"
+ }
+ ],
+ "deferred": []
+ },
+ "priority": 55,
+ "constraints": [
+ {
+ "inclusive": false,
+ "types": ["OPTICAL"],
+ "type": "LinkTypeConstraint"
+ }
+ ],
+ "ingressPoint": {
+ "port": "1",
+ "device": "of:0000000000000001"
+ },
+ "egressPoint": {
+ "port": "2",
+ "device": "of:0000000000000007"
+ }
+}