[ONOS-3603] Implement REST API for Group query, insert, delete
* Implement decoding feature for GroupBucketCodec and GroupCodec
* Implement GroupsWebResource
* Add unit test for GroupBucketCodec and GroupCodec
* Add unit test for GroupsWebResource
* Add group insertion json example
* Add Swagger doc
Change-Id: Ie58cba2e1af996c7b8652a55d9ef0c27207beafc
diff --git a/web/api/src/main/resources/definitions/GroupsPost.json b/web/api/src/main/resources/definitions/GroupsPost.json
new file mode 100644
index 0000000..f096201
--- /dev/null
+++ b/web/api/src/main/resources/definitions/GroupsPost.json
@@ -0,0 +1,84 @@
+{
+ "type": "object",
+ "title": "group",
+ "required": [
+ "type",
+ "deviceId",
+ "appCookie",
+ "groupId",
+ "buckets"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "ALL"
+ },
+ "deviceId": {
+ "type": "string",
+ "example": "of:0000000000000001"
+ },
+ "appCookie": {
+ "type": "string",
+ "example": "1"
+ },
+ "groupId": {
+ "type": "string",
+ "example": "1"
+ },
+ "buckets": {
+ "type": "array",
+ "xml": {
+ "name": "buckets",
+ "wrapped": true
+ },
+ "items": {
+ "type": "object",
+ "title": "buckets",
+ "required": [
+ "treatment",
+ "weight",
+ "watchPort",
+ "watchGroup"
+ ],
+ "properties": {
+ "treatment": {
+ "type": "object",
+ "title": "treatment",
+ "required": [
+ "instructions",
+ "deferred"
+ ],
+ "properties": {
+ "instructions": {
+ "type": "array",
+ "title": "treatment",
+ "required": [
+ "properties",
+ "port"
+ ],
+ "items": {
+ "type": "object",
+ "title": "instructions",
+ "required": [
+ "type",
+ "port"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "example": "OUTPUT"
+ },
+ "port": {
+ "type": "string",
+ "example": "2"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file