/* * Copyright (c) 2015 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 renderer { yang-version 1; namespace "urn:opendaylight:groupbasedpolicy:renderer"; prefix "gbp-renderer"; import gbp-common { prefix gbp-common; revision-date 2014-04-21; } import policy { prefix policy; revision-date 2014-04-21; } import resolved-policy { prefix resolved-policy; revision-date 2015-08-28; } import base-endpoint { prefix base-endpoint; revision-date 2016-04-27; } import forwarding { prefix forwarding; revision-date 2016-04-27; } import ietf-inet-types { prefix inet; revision-date 2010-09-24; } description "This module defines renderer capabilities."; revision "2015-11-03" { description "Initial revision."; } typedef renderer-name { type gbp-common:name; description "A name for a renderer"; } typedef policy-name { type string; } typedef endpoint-policy-participation { type enumeration { enum PROVIDER; enum CONSUMER; } } grouping supported-string-value-fields { list supported-string-value { description "String value has to be identical."; key value; leaf value { type string; } } } grouping supported-int-value-fields { list supported-int-value { description "Int value has to be identical."; key value; leaf value { type int64; } } list supported-int-value-in-range { description "Int value has to be inside the range include boundaries."; key "min max"; leaf min { type int64; } leaf max { type int64; } } } grouping supported-range-value-fields { list supported-range-value { description "Min and max values have to be inside the range include boundaries."; key "min max"; leaf min { type int64; } leaf max { type int64; } } } grouping has-parameters-type { choice parameter-type { case string { uses supported-string-value-fields; } case int { uses supported-int-value-fields; } case range { uses supported-range-value-fields; } } } grouping has-peer-endpoints { list peer-endpoint { key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; } } grouping has-peer-external-endpoints { list peer-external-endpoint { key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; } } grouping has-peer-external-containment-endpoints { list peer-external-containment-endpoint { key "context-type context-id"; uses forwarding:context-key; } } grouping has-renderer-name { leaf renderer-name { type renderer-name; mandatory true; } } grouping has-rule-group-with-renderer-endpoint-participation { list rule-group-with-renderer-endpoint-participation { description "A specific policy rule group that apply to pair of endpoints. Entire rule-group is located on /renderers/renderer/renderer-policy/configuration/rule-groups/rule-group"; key "tenant-id contract-id subject-name renderer-endpoint-participation"; uses resolved-policy:has-subject-key; leaf renderer-endpoint-participation { type endpoint-policy-participation; } } } container renderers { list renderer { description "A renderer provides a list of capabilities and status about configured policy. The renderer must store data only to OPER!"; key name; leaf name { description "A user-visible name for the renderer."; type renderer-name; } container renderer-nodes { description "Contains location of nodes (network elements) which are configured by the renderer."; config false; list renderer-node { key "node-path"; leaf node-path { description "Path to the node where policy needs to be enforced. This field is matched against internal-node and external-node-mount-point from base-endoint:endpoint-locations."; type instance-identifier; } } } container renderer-policy { description "Policy is named by version and describes desired vs real state. Desired state of policy described by /renderers/renderer/renderer-policy/configuration and version are stored in CONF. The real state of policy described by /renderers/renderer/renderer-policy/status and version are stored in OPER."; leaf version { description "Version in CONF represents desired state of policy while version in OPER means real state."; type uint32; mandatory true; } container configuration { description "Renderer tries to apply given policy on devices."; container renderer-endpoints { list renderer-endpoint { min-elements 1; description "Policy between renderer-endpoint and peer-endpoints (peers). Renderer configures policy for renderer endpoints."; key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; list peer-endpoint-with-policy { key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; uses has-rule-group-with-renderer-endpoint-participation; } list peer-external-endpoint-with-policy { key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; uses has-rule-group-with-renderer-endpoint-participation; } list peer-external-containment-endpoint-with-policy { key "context-type context-id"; uses forwarding:context-key; uses has-rule-group-with-renderer-endpoint-participation; } } } container rule-groups { list rule-group { min-elements 1; description "A specific policy rule group that apply to pair of endpoints. The policy rule group represents the subject with resolved rules."; key "tenant-id contract-id subject-name"; uses resolved-policy:has-subject-key; uses policy:has-order; uses resolved-policy:has-resolved-rules; } } container endpoints { list address-endpoint-with-location { min-elements 1; key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-fields; uses base-endpoint:has-location; uses has-renderer-name; } list containment-endpoint-with-location { key "context-type context-id"; uses base-endpoint:containment-endpoint-fields; uses base-endpoint:has-relative-location; } } container forwarding-contexts { list forwarding-context-by-tenant { min-elements 1; key tenant-id; uses forwarding:forwarding-with-tenant-fields; } } } container status { description "The renderer exposes status of policy here."; config false; list unconfigured-rule { key "tenant-id contract-id subject-name renderer-endpoint-participation rule-name"; uses resolved-policy:has-subject-key; leaf renderer-endpoint-participation { type endpoint-policy-participation; } leaf rule-name { type gbp-common:rule-name; } container renderer-endpoints-with-peers { list renderer-endpoint-with-peers { key "context-type context-id address-type address"; uses base-endpoint:address-endpoint-key; uses has-peer-endpoints; uses has-peer-external-endpoints; uses has-peer-external-containment-endpoints; } } } } } // TODO remove - does not make sense anymore container interests { status deprecated; config false; description "Represents interests of the renderer."; container followed-tenants { description "Interesting tenants for the renderer."; list followed-tenant { description "Tenant which is followed by the renderer."; key id; leaf id { type gbp-common:tenant-id; } list followed-endpoint-group { description "Endpoint-group which is followed by the renderer."; key id; leaf id { type gbp-common:endpoint-group-id; } } } } } container capabilities { config false; description "Capabilities this renderer provides."; list supported-classifier-definition { description "Classifier definitions this renderer can use."; key classifier-definition-id; leaf classifier-definition-id { description "Reference to a classifier definition in config datastore."; type leafref { path "/policy:subject-feature-definitions/policy:classifier-definition/policy:id"; } } leaf parent-classifier-definition-id { description "Optional reference to a parent classifier definition, to provide a hierarchical structure."; type leafref { path "/policy:subject-feature-definitions/policy:classifier-definition/policy:id"; } } list supported-parameter-values { description "Represents supported paramters and its values by renderer. If it contains only parameter-name without paramater-type, it means that any value is supported."; key parameter-name; leaf parameter-name { description "TODO"; type leafref { path "/policy:subject-feature-definitions/policy:classifier-definition/policy:parameter/policy:name"; } } uses has-parameters-type; } } list supported-action-definition { description "Action definitions this renderer can use."; key action-definition-id; leaf action-definition-id { description "Reference to an action definition in config datastore."; type leafref { path "/policy:subject-feature-definitions/policy:action-definition/policy:id"; } } leaf parent-action-definition-id { description "Optional reference to a parent action definition, to provide a hierarchical structure."; type leafref { path "/policy:subject-feature-definitions/policy:action-definition/policy:id"; } } list supported-parameter-values { description "Represents supported paramters and its values by renderer. If it contains only parameter-name without paramater-type, it means that any value is supported."; key parameter-name; leaf parameter-name { description "TODO"; type leafref { path "/policy:subject-feature-definitions/policy:action-definition/policy:parameter/policy:name"; } } uses has-parameters-type; } } } } } }