--- /dev/null
+/*\r
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+module endpoint-locations {\r
+ yang-version 1;\r
+\r
+ namespace "urn:opendaylight:groupbasedpolicy:endpoint:location";\r
+ prefix "endpoints-location";\r
+\r
+ import endpoint {\r
+ prefix endpoint;\r
+ revision-date 2014-04-21;\r
+ }\r
+\r
+ description\r
+ "This module defines network element structure for location provider.";\r
+\r
+ revision "2016-04-19" {\r
+ description\r
+ "Initial revision.";\r
+ }\r
+\r
+ typedef provider-name {\r
+ type string;\r
+ }\r
+\r
+ grouping has-regular-location {\r
+ leaf node {\r
+ mandatory true;\r
+ type instance-identifier;\r
+ }\r
+ leaf node-connector {\r
+ type instance-identifier;\r
+ }\r
+ }\r
+\r
+ grouping has-external-location{\r
+ leaf external-node-mount-point {\r
+ mandatory true;\r
+ type instance-identifier;\r
+ }\r
+ leaf external-node-location {\r
+ type string;\r
+ //TODO switch to external-reference\r
+ }\r
+ leaf external-node-connector {\r
+ type string;\r
+ //TODO above\r
+ }\r
+ }\r
+\r
+ grouping has-location {\r
+ container real-location {\r
+ choice location-type {\r
+ case regular-location {\r
+ uses has-regular-location;\r
+ }\r
+ case external-location {\r
+ uses has-external-location;\r
+ }\r
+ }\r
+ }\r
+ container relative-location {\r
+ list location {\r
+ key "node node-connector";\r
+ uses has-regular-location;\r
+ }\r
+ list external-location {\r
+ key "external-node-mount-point external-node-connector";\r
+ uses has-external-location;\r
+ }\r
+ }\r
+ }\r
+\r
+ container endpoint-locations {\r
+ list location-provider {\r
+ key "provider";\r
+ leaf provider {\r
+ type provider-name;\r
+ }\r
+ list endpoint-location {\r
+ key "l2-context mac-address";\r
+ uses endpoint:l2-key;\r
+ uses has-location;\r
+ }\r
+ list l3-endpoint-location {\r
+ key "l3-context ip-address";\r
+ uses endpoint:l3-key;\r
+ uses has-location;\r
+ }\r
+ list l3-prefix-endpoint-location {\r
+ key "l3-context ip-prefix";\r
+ uses endpoint:l3-prefix-key;\r
+ uses has-location;\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file