+/*
+ * 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 endpoint {
yang-version 1;
description
"The fields that identify an endpoint by a layer 2 address";
leaf l2-context {
- type gbp-common:l2-context-id;
+ type gbp-common:l2-bridge-domain-id;
description
- "The context for the layer 2 address for this endpoint";
+ "The bridge domain for the layer 2 address for this endpoint";
}
leaf mac-address {
type yang:mac-address;
}
}
+ grouping l3-prefix-key {
+ description
+ "The fields that identify an endpoint by a layer 3 prefix";
+ leaf l3-context {
+ type gbp-common:l3-context-id;
+ mandatory true;
+ description
+ "The context for this layer 3 prefix";
+ }
+ leaf ip-prefix {
+ type inet:ip-prefix;
+ mandatory true;
+ description
+ "The IP prefix for the endpoint";
+ }
+ }
+
// A base type for an end point
grouping endpoint-fields {
description "An endpoint and its associated metadata";
}
uses l2-key;
-
+
+ leaf network-containment {
+ description
+ "The network domain associated with this endpoint's fowarding
+ context.";
+ type gbp-common:network-domain-id;
+ }
list l3-address {
description
"All the layer 3 addresses associated with this endpoint";
key "l3-context ip-address";
uses l3-key;
- leaf ip-prefix {
- type inet:ip-prefix;
- description
- "The subnet for this address";
- }
}
leaf endpoint-group {
type gbp-common:endpoint-group-id;
description
"The group associated with this endpoint";
}
+ leaf-list endpoint-groups {
+ type gbp-common:endpoint-group-id;
+ description
+ "The groups associated with this endpoint";
+ ordered-by user;
+ }
leaf-list condition {
type gbp-common:condition-name;
description
"The conditions associated with this endpoint";
}
+ // This was a mistake and now it's an abomination.
+ leaf port-name {
+ type gbp-common:name;
+ description
+ "Port name";
+ } // end the abomination.
+ leaf timestamp {
+ type int64;
+ description
+ "The last timestamp associated with this endpoint record.
+ This will be used for aging data in the registry.";
+ }
+ }
+
+ // L3 Prefix EndPointFields
+ grouping endpoint-l3-prefix-fields {
+ description "An l3 prefix endpoint and its associated metadata";
+ uses l3-prefix-key;
+ leaf tenant {
+ type gbp-common:tenant-id;
+ mandatory true;
+ description
+ "The tenant with which this endpoint is associated";
+ }
+ leaf endpoint-group {
+ type gbp-common:endpoint-group-id;
+ description
+ "The group associated with this endpoint";
+ }
+ leaf-list endpoint-groups {
+ type gbp-common:endpoint-group-id;
+ description
+ "The groups associated with this endpoint";
+ ordered-by user;
+ }
+ leaf-list condition {
+ type gbp-common:condition-name;
+ description
+ "The conditions associated with this endpoint";
+ }
+ list endpoint-l2-gateways {
+ key "l2-context mac-address";
+ uses l2-key;
+ }
+ list endpoint-l3-gateways {
+ key "l3-context ip-address";
+ uses l3-key;
+ }
leaf timestamp {
type int64;
description
description
"Repository for operational state data about endpoints needed for
policy resolution.";
+ config false;
list endpoint {
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";
-
- 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";
- }
-
+ uses l3-key;
uses endpoint-fields;
}
+ list endpoint-l3-prefix {
+ key "l3-context ip-prefix";
+ uses endpoint-l3-prefix-fields;
+ }
+
list condition-mapping {
description
"A list mapping conditions to entire endpoint groups.
}
}
+ rpc register-l3-prefix-endpoint {
+ description
+ "Register an L3 Prefix Endpoint to the endpoint registery. If there
+ is already an existing endpoint with the same keys, they
+ will be overwritten with the new information.";
+
+ input {
+ uses endpoint-l3-prefix-fields;
+ }
+ }
+
rpc unregister-endpoint {
description "Unregister an endpoint or endpoints from the registry.";
key "l3-context ip-address";
uses l3-key;
}
+ list l3-prefix {
+ key "l3-context ip-prefix";
+ uses l3-prefix-key;
+ }
}
}