REST API to create flows
Change-Id: I5d001782249c0eab249d7aa857ae465da95b5955
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/criteria-flow.json b/core/common/src/test/resources/org/onosproject/codec/impl/criteria-flow.json
new file mode 100644
index 0000000..6df4d0a
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/criteria-flow.json
@@ -0,0 +1,44 @@
+{
+ "appId":-29467,
+ "priority":1,
+ "isPermanent":"false",
+ "timeout":1,
+ "deviceId":"of:0000000000000001",
+ "selector":
+ {"criteria":
+ [
+ {"type":"IN_PORT", "port":23},
+ {"type":"IN_PHY_PORT", "port":44},
+ {"type":"METADATA", "metadata":123456},
+ {"type":"ETH_TYPE","ethType":2054},
+ {"type":"ETH_SRC","mac":"00:11:22:33:44:55"},
+ {"type":"ETH_DST","mac":"00:11:22:33:44:55"},
+ {"type":"VLAN_VID","vlanId":777},
+ {"type":"VLAN_PCP","priority":3},
+ {"type":"IP_DSCP","ipDscp":2},
+ {"type":"IP_ECN","ipEcn":1},
+ {"type":"IP_PROTO","protocol":4},
+ {"type":"IPV4_SRC", "ip":"1.2.0.0/32"},
+ {"type":"IPV4_DST", "ip":"2.2.0.0/32"},
+ {"type":"IPV6_SRC", "ip":"3.2.0.0/32"},
+ {"type":"IPV6_DST", "ip":"4.2.0.0/32"},
+ {"type":"TCP_SRC", "tcpPort":80},
+ {"type":"TCP_DST", "tcpPort":443},
+ {"type":"UDP_SRC", "udpPort":180},
+ {"type":"UDP_DST", "udpPort":1443},
+ {"type":"SCTP_SRC", "sctpPort":280},
+ {"type":"SCTP_DST", "sctpPort":2443},
+ {"type":"ICMPV4_TYPE", "icmpType":24},
+ {"type":"ICMPV4_CODE", "icmpCode":16},
+ {"type":"ICMPV6_TYPE", "icmpv6Type":14},
+ {"type":"ICMPV6_CODE", "icmpv6Code":6},
+ {"type":"IPV6_FLABEL", "flowLabel":8},
+ {"type":"IPV6_ND_TARGET", "targetAddress":"1111:2222:3333:4444:5555:6666:7777:8888"},
+ {"type":"IPV6_ND_SLL", "mac":"00:11:22:33:44:56"},
+ {"type":"IPV6_ND_TLL", "mac":"00:11:22:33:44:57"},
+ {"type":"MPLS_LABEL", "label":123},
+ {"type":"IPV6_EXTHDR", "exthdrFlags":99},
+ {"type":"OCH_SIGID", "lambda":122}
+ ]
+ }
+}
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/instructions-flow.json b/core/common/src/test/resources/org/onosproject/codec/impl/instructions-flow.json
new file mode 100644
index 0000000..d60362d
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/instructions-flow.json
@@ -0,0 +1,35 @@
+{
+ "appId":-29467,
+ "priority":1,
+ "isPermanent":"false",
+ "timeout":1,
+ "deviceId":"of:0000000000000001",
+ "treatment":
+ {
+ "instructions":
+ [
+ {"type":"OUTPUT","port":-3},
+ {"type":"DROP"},
+ {"type":"L2MODIFICATION","subtype":"ETH_SRC","mac":"12:34:56:78:90:12"},
+ {"type":"L2MODIFICATION","subtype":"ETH_DST","mac":"98:76:54:32:01:00"},
+ {"type":"L2MODIFICATION","subtype":"VLAN_ID","vlanId":22},
+ {"type":"L2MODIFICATION","subtype":"VLAN_PCP","vlanPcp":1},
+ {"type":"L2MODIFICATION","subtype":"MPLS_LABEL","label":777},
+ {"type":"L2MODIFICATION","subtype":"MPLS_PUSH"},
+ {"type":"L2MODIFICATION","subtype":"MPLS_POP"},
+ {"type":"L2MODIFICATION","subtype":"DEC_MPLS_TTL"},
+ {"type":"L2MODIFICATION","subtype":"VLAN_POP"},
+ {"type":"L2MODIFICATION","subtype":"VLAN_PUSH"},
+ {"type":"L3MODIFICATION","subtype":"IPV4_SRC", "ip":"1.2.3.4"},
+ {"type":"L3MODIFICATION","subtype":"IPV4_DST", "ip":"1.2.3.3"},
+ {"type":"L3MODIFICATION","subtype":"IPV6_SRC", "ip":"1.2.3.2"},
+ {"type":"L3MODIFICATION","subtype":"IPV6_DST", "ip":"1.2.3.1"},
+ {"type":"L3MODIFICATION","subtype":"IPV6_FLABEL", "flowLabel":8},
+ {"type":"L0MODIFICATION","subtype":"LAMBDA","lambda":7},
+ {"type":"L0MODIFICATION","subtype":"OCH","gridType":"DWDM",
+ "channelSpacing":"CHL_100GHZ","spacingMultiplier":4,"slotGranularity":8}
+ ],
+ "deferred":[]
+ },
+ "selector": {"criteria":[{"type":"ETH_TYPE","ethType":2054}]}
+}
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/sigid-flow.json b/core/common/src/test/resources/org/onosproject/codec/impl/sigid-flow.json
new file mode 100644
index 0000000..ba576bf
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/sigid-flow.json
@@ -0,0 +1,21 @@
+{
+ "appId":-29467,
+ "priority":1,
+ "isPermanent":"false",
+ "timeout":1,
+ "deviceId":"of:0000000000000001",
+ "selector":
+ {"criteria":
+ [
+ {"type":"OCH_SIGID",
+ "ochSignalId":
+ {
+ "gridType":"CWDM",
+ "channelSpacing":"CHL_25GHZ",
+ "spacingMultiplier":3,
+ "slotGranularity":4
+ }
+ }
+ ]
+ }
+}
diff --git a/core/common/src/test/resources/org/onosproject/codec/impl/simple-flow.json b/core/common/src/test/resources/org/onosproject/codec/impl/simple-flow.json
new file mode 100644
index 0000000..4011c2d
--- /dev/null
+++ b/core/common/src/test/resources/org/onosproject/codec/impl/simple-flow.json
@@ -0,0 +1,13 @@
+{
+ "appId":-29467,
+ "priority":1,
+ "isPermanent":"false",
+ "timeout":1,
+ "deviceId":"of:0000000000000001",
+ "treatment":
+ {"instructions":
+ [{"type":"OUTPUT","port":-3}],"deferred":[]},
+ "selector":
+ {"criteria":
+ [{"type":"ETH_TYPE","ethType":2054}]}
+}