[VOL-785,VOL-786,VOL-1315,VOL-1316]
Initial commit of the affinity router's data plane

Change-Id: Iccc93b5526d5d2468b33eff7d8847e22fb88ef2d
diff --git a/afrouter/arouter.json b/afrouter/arouter.json
new file mode 100644
index 0000000..50e1d31
--- /dev/null
+++ b/afrouter/arouter.json
@@ -0,0 +1,184 @@
+{
+    "servers": [
+	    {
+		    "name": "grpc_command",
+			"port": 55555,
+			"address":"",
+			"type": "grpc",
+			"routers": [
+				{
+					"_TODO":"Suport a router list, remove the package and service from the router",
+					"package":"voltha",
+					"service":"VolthaService",
+					"router":"vcore"
+				}
+			]
+		}
+	],
+	"routers": [
+	    {
+		    "name":"vcore",
+			"package": "voltha",
+			"service": "VolthaService",
+            "routes": [
+				{
+					"name":"dev_manager",
+            		"proto_descriptor":"voltha.pb",
+		   			"type":"rpc_affinity_message",
+		   			"association":"round_robin",
+           			"routing_field": "id",
+					"backend_cluster":"vcore",
+					"_COMMENT":"Methods are naturally southbound affinity binding unless otherwise specified below",
+					"methods":[ "CreateDevice",
+								"GetCoreInstance",
+								"EnableLogicalDevicePort",
+								"DisableLogicalDevicePort",
+								"EnableDevice",
+								"DisableDevice",
+								"RebootDevice",
+								"DeleteDevice",
+								"DownloadImage",
+								"CancelImageDownload",
+								"ActivateImageUpdate",
+								"RevertImageUpdate",
+								"UpdateDevicePmConfigs",
+								"CreateAlarmFilter",
+								"UpdateAlarmFilter",
+								"DeleteAlarmFilter",
+								"SelfTest"],
+					"_COMMENT":"If a method is northbound affinity binding then association is used to route",
+					"_COMMENT":"but affinity is not set southbound but only based on the response",
+					"_COMMENT":"Methods here MUST be specified above, this overrides thier default beahvior",
+					"nb_binding_methods":["CreateDevice"],
+					"_TODO":"Overrides not implemented yet, config ignored",
+					"overrides": [
+               			{"methods":["abc","def"], "routing_field":"id"},
+               			{"methods":["ghi","jkl"]},
+               			{"method":"mno", "routing_field":"id"},
+               			{"method":"pqr"}
+					]
+				},
+				{
+					"name":"read_only",
+		   			"type":"round_robin",
+		   			"association":"round_robin",
+					"backend_cluster":"vcore",
+					"methods":[ "ListDevicePorts",
+								"ListDevicePmConfigs",
+								"GetImages",
+								"GetImageDownloadStatus",
+								"GetImageDownload",
+								"ListImageDownloads",
+								"ListDeviceFlows",
+								"ListDeviceFlowGroups",
+								"ListLogicalDeviceFlows",
+								"ListLogicalDeviceFlowGroups",
+								"ListDevices",
+								"GetDevice",
+								"GetDeviceType",
+								"GetDeviceGroup",
+								"GetLogicalDevice",
+								"GetAlarmFilter",
+								"ListLogicalDevicePorts",
+								"GetLogicalDevicePort"
+					]
+				},
+				{
+					"name":"dev_manager_ofagent",
+		   			"type":"binding",
+		   			"_association":"round_robin",
+					"binding": {
+						"type":"header",
+						"field":"voltha_backend_name",
+						"method":"Subscribe",
+						"association":"round_robin"
+					},
+					"backend_cluster":"vcore",
+                    "methods":["StreamPacketsOut",
+                               "Subscribe",
+                               "ListLogicalDevices",
+                               "ListDeviceFlowGroups",
+                               "ListLogicalDeviceFlowGroups",
+                               "ListDeviceFlows",
+                               "UpdateLogicalDeviceFlowTable",
+                               "UpdateLogicalDeviceFlowGroupTable",
+                               "ListLogicalDeviceFlows"
+					],
+					"_TODO":"Overrides not implemented yet, config ignored",
+					"overrides": [
+               			{"methods":["abc","def"], "routing_field":"id"},
+               			{"methods":["ghi","jkl"]},
+               			{"method":"mno", "routing_field":"id"},
+               			{"method":"pqr"}
+					]
+				}
+            ]
+		 }
+	],
+	"backend_clusters": [
+	  {
+        "name":"vcore",
+		"backends":[ {
+			"name":"vcore1",
+			"type":"active_active",
+			"association": {
+				"strategy":"serial_number",
+				"location":"header",
+				"_TODO":"The key below needs to be implemented, currently hard coded",
+				"key":"voltha_serial_number"
+			},
+			"connections": [ {
+		   		"name":"vcore11",
+		   		"addr":"",
+		   		"port":""
+			},
+			{
+				"name":"vcore12",
+				"addr":"",
+				"port":""
+			}]
+		},
+		{
+			"name":"vcore2",
+			"type":"active_active",
+			"association": {
+				"strategy":"serial_number",
+				"location":"header"
+			},
+			"connections": [ {
+		   		"name":"vcore21",
+		   		"addr":"",
+		   		"port":""
+			},
+			{
+				"name":"vcore22",
+				"addr":"",
+				"port":""
+			}]
+		},
+		{
+			"name":"vcore3",
+			"type":"active_active",
+			"association": {
+				"strategy":"serial_number",
+				"location":"header"
+			},
+			"connections": [ {
+		   		"name":"vcore31",
+		   		"addr":"",
+		   		"port":""
+			},
+			{
+				"name":"vcore32",
+				"addr":"",
+				"port":""
+			}]
+		}]
+	  }
+	],
+	"api": {
+		"_comment":"If this isn't defined then no api is available for dynamic configuration and queries",
+		"address":"",
+		"port":55554
+	}
+}