/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module openstack-endpoint { yang-version 1; namespace "urn:opendaylight:groupbasedpolicy:openstackendpoint"; prefix "gbp-openstackendpoint"; import gbp-common {prefix gbp-common;} import ietf-inet-types {prefix inet;} import ietf-yang-types { prefix yang; revision-date 2010-09-24; } /* import endpoint { prefix endpoint; revision-date 2014-04-21; } */ revision "2014-12-04" { description "Initial revision."; } grouping l2-key { description "The fields that identify an endpoint by a layer 2 address"; leaf l2-context { type gbp-common:l2-bridge-domain-id; description "The bridge domain for the layer 2 address for this endpoint"; } leaf mac-address { type yang:mac-address; description "The MAC address for the endpoint"; } } grouping l3-key { description "The fields that identify an endpoint by a layer 3 address"; leaf l3-context { type gbp-common:l3-context-id; mandatory true; description "The context for this layer 3 address"; } leaf ip-address { type inet:ip-address; mandatory true; description "The actual IP address for the endpoint"; } } // A base type for an end point grouping endpoint-fields { description "An endpoint and its associated metadata"; leaf tenant { type gbp-common:tenant-id; mandatory true; description "The tenant with which this endpoint is associated"; } uses l2-key; list l3-address { description "All the layer 3 addresses associated with this endpoint"; key "l3-context ip-address"; uses l3-key; } leaf endpoint-group { type gbp-common:endpoint-group-id; description "The group associated with this endpoint"; } leaf-list condition { type gbp-common:condition-name; description "The conditions associated with this endpoint"; } leaf timestamp { type int64; description "The last timestamp associated with this endpoint record. This will be used for aging data in the registry."; } leaf neutron-port-id { description "Tap port known to neutron at time of VM creation"; type gbp-common:name; } } grouping has-endpoint-group-conditions { description "Base type for object with endpoint group to condition mappings."; leaf endpoint-group { description "The endpoint group conditions to assign"; type gbp-common:endpoint-group-id; } list endpoint-group-condition { description "The conditions associated with this endpoint group"; key "condition"; leaf condition { description "A condition name to associate."; type gbp-common:condition-name; } } } // A base type for an end point container openstack-endpoints { description "Repository for operational state data about endpoints needed for policy resolution."; config false; list endpoint { description "Endpoints indexed by layer 2 addreses. When modifying data here, you must also modify data in the endpoints-l3 list as well."; key "l2-context mac-address"; uses endpoint-fields; } list endpoint-l3 { description "Endpoints indexed by layer 3 addreses. When modifying data here, you must also modify data in the endpoints list as well."; key "l3-context ip-address"; uses l3-key; uses endpoint-fields; } list condition-mapping { description "A list mapping conditions to entire endpoint groups. This offers a quickly way to set a condition on many endpoints at once."; key "endpoint-group"; uses has-endpoint-group-conditions; } } rpc unregister-endpoint { description "Unregister an endpoint or endpoints from the registry."; input { list l2 { key "l2-context mac-address"; uses l2-key; } list l3 { key "l3-context ip-address"; uses l3-key; } } } rpc register-endpoint { description "Register a new endpoint into the registry. If there is already an existing endpoint with the same keys, they will be overwritten with the new information."; input { uses endpoint-fields; } } } }