Introducing new API in neutron-mapper
[groupbasedpolicy.git] / neutron-mapper / src / main / yang / neutron-gbp-mapper.yang
index 5ba306a8345f1c4cc066993dfb09f3f4cf58b759..207cc25b63a661a8b632b49e12eabac75ff1955a 100644 (file)
@@ -4,14 +4,17 @@ module neutron-gbp-mapper {
     namespace "urn:opendaylight:groupbasedpolicy:neutron-gbp-mapper";
     prefix "neutron-gbp-mapper";
 
-    import gbp-common {prefix gbp-common;}
-    import endpoint {prefix gbp-endpoint;}
-    import ietf-inet-types {
-        prefix inet;
-        revision-date 2010-09-24;
-    }
+    import gbp-common { prefix gbp-common; }
+    import endpoint { prefix gbp-endpoint; }
+    import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import base-endpoint { prefix base-ep; revision-date 2016-04-27; }
+    import forwarding { prefix fwd; revision-date 2016-04-27; }
+    import l2-l3-forwarding { prefix l2-l3; revision-date 2016-04-27; }
+
 
-    description 
+
+    description
         "This module defines the mapping model between Neutron entities and GBP entities.";
 
     revision "2015-05-13" {
@@ -33,6 +36,7 @@ module neutron-gbp-mapper {
             description "Neutron entities by groupbasedpolicy entities";
             container ports-by-endpoints {
                 description "Neutron ports by groupbasedpolicy endpoint";
+                status deprecated;
                 list port-by-endpoint {
                     description "Neutron port key by groupbasedpolicy endpoint key";
                     key "l2-context mac-address";
@@ -40,8 +44,31 @@ module neutron-gbp-mapper {
                     uses neutron-port-key;
                 }
             }
+            container ports-by-base-endpoints {
+                description "Neutron ports by groupbasedpolicy base-endpoint";
+                list port-by-base-endpoint {
+                    description "Neutron port key by groupbasedpolicy base-endpoint key";
+                    key "context-type context-id address-type address";
+                    uses base-ep:address-endpoint-key;
+                    uses neutron-port-key;
+                }
+            }
+
+            container external-gateways-as-endpoints {
+                description "Endpoints that represent Neutron External Gateways for External Subnets.
+                    Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
+                list external-gateway-as-endpoint {
+                    description "Endpoints that represent Neutron External Gateways for External Subnets.
+                        Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
+
+                    key "context-id context-type address address-type";
+
+                    uses base-ep:address-endpoint-key;
+                }
+            }
 
             container external-gateways-as-l3-endpoints {
+                status deprecated; // use external-gateways-as-endpoints
                 description "L3Endpoints that represent Neutron External Gateways for External Subnets.
                     Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
                 list external-gateway-as-l3-endpoint {
@@ -51,12 +78,55 @@ module neutron-gbp-mapper {
                     uses gbp-endpoint:l3-key;
                 }
             }
+
+            container provider-physical-networks-as-l2-flood-domains {
+                status deprecated;
+                list provider-physical-network-as-l2-flood-domain {
+                    key "tenant-id l2-flood-domain-id";
+                    leaf tenant-id {
+                        description "Tenant of L2 Flood Domain";
+                        type gbp-common:tenant-id;
+                    }
+                    leaf l2-flood-domain-id {
+                        description "The L2 Flood Domain ID";
+                        type gbp-common:l2-flood-domain-id;
+                    }
+                    leaf segmentation-id {
+                        mandatory true;
+                        description "An isolated segment on the physical network. The network-type
+                            attribute defines the segmentation model. For example, if network-type
+                            is vlan, this ID is a vlan identifier.";
+                        type string;
+                    }
+                }
+            }
+
+            container provider-networks-as-l2-flood-domains {
+                list provider-physical-network-as-l2-flood-domain {
+                    key "tenant-id l2-flood-domain-id";
+                    leaf tenant-id {
+                        description "Tenant of L2 Flood Domain";
+                        type gbp-common:tenant-id;
+                    }
+                    leaf l2-flood-domain-id {
+                        type gbp-common:context-id;
+                    }
+                    leaf segmentation-id {
+                        mandatory true;
+                        description "An isolated segment on the physical network. The network-type
+                            attribute defines the segmentation model. For example, if network-type
+                            is vlan, this ID is a vlan identifier.";
+                        type string;
+                    }
+                }
+            }
         }
 
         container gbp-by-neutron-mappings {
             description "Groupbasedpolicy entities by neutron entities";
             container endpoints-by-ports {
                 description "Groupbasedpolicy endpoints by neutron ports";
+                status deprecated;
                 list endpoint-by-port {
                     description "Groupbasedpolicy endpoint key by neutron port key";
                     key port-id;
@@ -64,8 +134,42 @@ module neutron-gbp-mapper {
                     uses gbp-endpoint:l2-key;
                 }
             }
+            container base-endpoints-by-ports {
+                description "Groupbasedpolicy base-endpoints by neutron ports";
+                list base-endpoint-by-port {
+                    description "Groupbasedpolicy base-endpoint key by neutron port key";
+                    key port-id;
+                    uses neutron-port-key;
+                    uses base-ep:address-endpoint-key;
+                }
+            }
         }
+    }
 
+    rpc change-action-of-security-group-rules {
+        input {
+            list security-group-rule {
+                key uuid;
+                leaf uuid {
+                    type yang:uuid;
+                    description "UUID to index this neutron security group rule.";
+                }
+            }
+            container action {
+                choice action-choice {
+                    case sfc-action-case {
+                        leaf sfc-chain-name {
+                            type string;
+                        }
+                    }
+                    case allow-action-case {
+                        container allow {
+                            presence true;
+                        }
+                    }
+                }
+            }
+        }
     }
 
 }