/* * * Copyright 2016-2017 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file rw-conman.yang * @author Manish Patel * @date 2015/10/27 * @brief Service Orchestrator configuration yang */ module rw-conman { namespace "http://riftio.com/ns/riftware-1.0/rw-conman"; prefix "rw-conman"; import rw-cli-ext { prefix "rwcli"; } import rw-project-vnfd { prefix "rw-project-vnfd"; } import rw-project-nsd { prefix "rw-project-nsd"; } import nsr { prefix "nsr"; } import rw-nsr { prefix "rw-nsr"; } import rw-vnfr { prefix "rw-vnfr"; } import rw-vlr { prefix "rwvlr"; } import rw-yang-types { prefix "rwt"; } import ietf-inet-types { prefix "inet"; } import ietf-yang-types { prefix "yang"; } import mano-base { prefix "manobase"; } import mano-types { prefix "manotypes"; } import rw-config-agent { prefix "rw-config-agent"; } import rw-project { prefix "rw-project"; } import rw-project-mano { prefix "rw-project-mano"; } revision 2017-02-08 { description "Update model to support projects."; } revision 2015-10-27 { description "Initial revision."; } // typedef ro-endpoint-method { // type enumeration { // enum netconf; // enum restconf; // } // } grouping ro-endpoint { // leaf ro-endpoint-method { // description "interface between CM & RO, defaults to netconf"; // type ro-endpoint-method; // default netconf; // } leaf ro-ip-address { type inet:ip-address; description "IP Address"; default "127.0.0.1"; } leaf ro-port { type inet:port-number; description "Port Number"; default 2022; } leaf ro-username { description "RO endpoint username"; type string; default "@rift"; } leaf ro-password { description "RO endpoint password"; type string; default "rift"; } } // =================== SHOW ================== typedef record-state { type enumeration { enum init; enum received; enum cfg-process; enum cfg-process-failed; enum cfg-sched; enum connecting; enum failed-connection; enum cfg-send; enum cfg-failed; enum ready-no-cfg; enum ready; enum terminate; } } grouping primitive-parameter { leaf name { description "Name of the parameter."; type string; } leaf data-type { description "Data type associated with the name."; type manotypes:parameter-data-type; } leaf mandatory { description "Is this field mandatory"; type boolean; default false; } leaf default-value { description "The default value for this field"; type string; } leaf parameter-pool { description "NSD parameter pool name to use for this parameter"; type string; } leaf read-only { description "The value should be dimmed by the UI. Only applies to parameters with default values."; type boolean; default false; } leaf hidden { description "The value should be hidden by the UI. Only applies to parameters with default values."; type boolean; default false; } leaf out { description "If this is an output of the primitive execution"; type boolean; default false; } } grouping vnf-configuration { container vnf-configuration { description "Information about the VNF configuration. Note: If the NS contains multiple instances of the same VNF, each instance could have a different configuration."; choice config-method { description "Defines the configuration method for the VNF."; case script { description "Use custom script for configuring the VNF. This script is executed in the context of Orchestrator (The same system and environment as the Launchpad)."; container script { leaf script-type { description "Script type - currently supported - Scripts confirming to Rift CA plugin"; type enumeration { enum rift; } } } } case juju { description "Configure the VNF through Juju."; container juju { leaf charm { description "Juju charm to use with the VNF."; type string; } } } } list config-primitive { description "List of config primitives supported by the configuration agent for this VNF."; key "name"; leaf name { description "Name of the config primitive."; type string; } list parameter { description "List of parameters to the config primitive."; key "name"; uses primitive-parameter; } leaf user-defined-script { description "A user defined script. If user defined script is defined, the script will be executed using bash"; type string; } } list initial-config-primitive { description "Initial set of configuration primitives."; key "seq"; leaf seq { description "Sequence number for the configuration primitive."; type uint64; } choice primitive-type { case primitive-definition { leaf name { description "Name of the configuration primitive."; type string; } uses manotypes:primitive-parameter-value; leaf user-defined-script { description "A user defined script."; type string; } } case primitive-ref { leaf config-primitive-ref { description "Reference to a config primitive name. NOTE: The config primitive referred should have all the input parameters predefined either with default values or dependency references."; type leafref { path "../../config-primitive/name"; } } } } } } } // END - grouping vnf-configuration // This is also used by RO (Resource Orchestrator) to indicate NSR is ready // It will only fill in IDs augment "/rw-project:project" { container cm-state { config false; description "CM NS & VNF states"; leaf states { description "CM various states"; type string; } list cm-nsr { description "List of NS Records"; key "id"; leaf id { type yang:uuid; } leaf name { description "NSR name."; type string; } leaf state { description "State of NSR"; type record-state; } leaf state-details { description "Details of the state of NSR, in case of errors"; type string; } list cm-vnfr { description "List of VNF Records within NS Record"; key "id"; leaf id { type yang:uuid; } leaf name { description "VNFR name."; type string; } leaf state { description "Last known state of this VNFR"; type record-state; } container mgmt-interface { leaf ip-address { type inet:ip-address; } leaf port { type inet:port-number; } } leaf cfg-type { type string; } list connection-point { key "name"; leaf name { description "Connection Point name"; type string; } leaf ip-address { description "IP address assigned to this connection point"; type inet:ip-address; } leaf connection-point-id { type string; } } // Publish the resolved capabilites and dependecies here container config-parameter { description "The resolved config parameter for a VNF"; list config-parameter-source { description "List of resolved sources"; key "name"; leaf name { type string { length 1..128; } description "Name of the source as defined in VNFD"; } leaf value { type string; description "Resovled value for the source"; } list parameter { key "config-primitive-ref"; leaf config-primitive-ref { type string; } leaf parameter-ref { type string; } } } list config-parameter-request { description "List of resolved requests for the the VNF"; key "name"; leaf name { type string { length 1..128; } description "Name of the request as defined in VNFD"; } leaf value { type string; description "Resovled value for the request"; } list parameter { key "config-primitive-ref"; leaf config-primitive-ref { type string; } leaf parameter-ref { type string; } } } } // Resolve the VNF config-primitives and publish it // here. VNFR will use this and update config-primitives // from here. uses vnf-configuration; } // list VNFR } // list NSR } // cm-state } } // rw-conman