import os
import yaml
-from gi.repository import NsdYang
-from gi.repository import VnfdYang
+from gi.repository import ProjectNsdYang as NsdYang
+from gi.repository import ProjectVnfdYang as VnfdYang
class InitialConfigReadError(Exception):
import pytest
import uuid
-from gi.repository import NsdYang, VnfdYang
+from gi.repository import (
+ ProjectNsdYang as NsdYang,
+ ProjectVnfdYang as VnfdYang,
+ )
from ..config import ConfigPrimitiveConvertor
import yaml
return "id"
def get_xpath(self):
- return self._project.add_project("C,/nsd:nsd-catalog/nsd:nsd")
+ return self._project.add_project("C,/project-nsd:nsd-catalog/project-nsd:nsd")
class NsInstanceConfigSubscriber(core.AbstractConfigSubscriber):
from gi.repository import (
RwLaunchpadYang as launchpadyang,
RwDts as rwdts,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwVnfrYang,
RwNsrYang,
- RwNsdYang,
+ RwProjectNsdYang as RwNsdYang,
VnfrYang
)
mock_vnfd = RwVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd()
mock_vnfd.id = str(uuid.uuid1())
- w_xpath = "C,/rw-project:project/vnfd:vnfd-catalog/vnfd:vnfd"
- xpath = "{}[vnfd:id='{}']".format(w_xpath, mock_vnfd.id)
+ w_xpath = "C,/rw-project:project/project-vnfd:vnfd-catalog/project-vnfd:vnfd"
+ xpath = "{}[project-vnfd:id='{}']".format(w_xpath, mock_vnfd.id)
yield from self.publisher.publish(w_xpath, xpath, mock_vnfd)
yield from asyncio.sleep(5, loop=self.loop)
mock_nsd = RwNsdYang.YangData_RwProject_Project_NsdCatalog_Nsd()
mock_nsd.id = str(uuid.uuid1())
- w_xpath = "C,/rw-project:project/nsd:nsd-catalog/nsd:nsd"
- xpath = "{}[nsd:id='{}']".format(w_xpath, mock_nsd.id)
+ w_xpath = "C,/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd"
+ xpath = "{}[project-nsd:id='{}']".format(w_xpath, mock_nsd.id)
yield from self.publisher.publish(w_xpath, xpath, mock_nsd)
yield from asyncio.sleep(2, loop=self.loop)
)
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
return "id"
def get_xpath(self):
- return self.project.add_project("C,/vnfd:vnfd-catalog/vnfd:vnfd")
+ return self.project.add_project("C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd")
# TODO(Philip): Harcoding for now, need to make this generic
def get_xpath(self):
- xpath = '/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:' + self.name
+ xpath = '/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/nsd:' + self.name
return xpath
def get_dict_output(self):
try:
import gi
gi.require_version('RwYang', '1.0')
- gi.require_version('RwNsdYang', '1.0')
- gi.require_version('NsdYang', '1.0')
+ gi.require_version('RwProjectNsdYang', '1.0')
+ gi.require_version('ProjectNsdYang', '1.0')
- from gi.repository import NsdYang
- from gi.repository import RwNsdYang
+ from gi.repository import ProjectNsdYang as NsdYang
+ from gi.repository import RwProjectNsdYang as RwNsdYang
from gi.repository import RwYang
except ImportError:
pass
try:
import gi
- gi.require_version('RwVnfdYang', '1.0')
+ gi.require_version('RwProjectVnfdYang', '1.0')
- from gi.repository import RwVnfdYang
+ from gi.repository import RwProjectVnfdYang as RwVnfdYang
except ImportError:
pass
except ValueError:
if idx == 0:
name = cls.from_xpath(xpath, log)
if name == project:
- log.warning("Project already in the XPATH: {}".format(xpath))
+ log.debug("Project already in the XPATH: {}".format(xpath))
return xpath
else:
self.inputs.append({
self.NAME:
self.map_yang_name_to_tosca(
- val.replace('/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:', ''))})
+ val.replace('/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/nsd:', ''))})
if len(param):
self.log.warn(_("{0}, Did not process the following for "
"input param {1}: {2}").
from rift.mano.config_data import config
import gi
-gi.require_version('VnfdYang', '1.0')
+gi.require_version('ProjectVnfdYang', '1.0')
gi.require_version('RwYang', '1.0')
from gi.repository import (
- VnfdYang,
+ ProjectVnfdYang,
RwYang,
)
1. Instance of project from xpath
2. project name in instance is correct
"""
- xpath = XPATH + '/rw:project/rw-project:project/rw-project:project/rw-project:project/rw-project:project/nsd:nsd-catalog/nsd:nsd[id=\'1232334\']'
+ xpath = XPATH + '/rw:project/rw-project:project/rw-project:project/rw-project:project/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[id=\'1232334\']'
proj = project.ManoProject.create_from_xpath(xpath, TestCase.log)
assert proj
assert NAME == proj.name
from gi.repository import (
RwYang,
- NsdYang,
- RwNsdYang,
- VnfdYang,
- RwVnfdYang,
+ ProjectNsdYang as NsdYang,
+ RwProjectNsdYang as RwNsdYang,
+ ProjectVnfdYang as VnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
VldYang,
RwVldYang
)
#!/usr/bin/env python3
-#
-# Copyright 2016 RIFT.IO Inc
+#
+# 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.
import gi
gi.require_version('RwYang', '1.0')
-from gi.repository import NsdYang, VldYang, VnfdYang, RwYang
+# TODO (Philip): Relook at this code
+
+from gi.repository import (
+ NsdYang,
+ VldYang,
+ VnfdYang,
+ RwYang
+ )
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def configure_vnfd(proxy, vnfd_xml_hdl):
vnfd_xml = vnfd_xml_hdl.read()
logger.debug("Attempting to deserialize XML into VNFD protobuf: %s", vnfd_xml)
- vnfd = VnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd()
+ vnfd = VnfdYang.YangData_VnfdCatalog_Vnfd()
vnfd.from_xml_v2(model, vnfd_xml)
logger.debug("Sending VNFD to netconf: %s", vnfd)
def configure_nsd(proxy, nsd_xml_hdl):
nsd_xml = nsd_xml_hdl.read()
logger.debug("Attempting to deserialize XML into NSD protobuf: %s", nsd_xml)
- nsd = NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd()
+ nsd = NsdYang.YangData_NsdCatalog_Nsd()
nsd.from_xml_v2(model, nsd_xml)
logger.debug("Sending NSD to netconf: %s", nsd)
action="append",
default=[],
type=argparse.FileType(),
- help="VLD XML File Path",
+ #help="VLD XML File Path",
+ # We do not support uploading VLD separately
+ help=argparse.SUPRESS,
)
parser.add_argument(
import gi
gi.require_version('RwYang', '1.0')
-gi.require_version('RwProjectYang', '1.0')
gi.require_version('RwVnfdYang', '1.0')
gi.require_version('VnfdYang', '1.0')
+gi.require_version('RwVnfdYang', '1.0')
gi.require_version('RwNsdYang', '1.0')
-gi.require_version('NsdYang', '1.0')
-
from gi.repository import (
- RwNsdYang,
- NsdYang,
- RwVnfdYang,
- VnfdYang,
+ RwNsdYang as RwNsdYang,
+ NsdYang as NsdYang,
+ RwVnfdYang as RwVnfdYang,
+ VnfdYang as VnfdYang,
RwYang,
- RwProjectYang,
)
for module in module_list:
model.load_module(module)
- # Need to extract the catalog part to dump as descriptor
- if output_format in ['json', 'yaml']:
- # Convert to yaml instead of directly using as_dict as
- # this adds the namespaces correctly
- ya = self.descriptor.to_yaml(model)
- proj = yaml.load(ya)
- desc = proj['rw-project:project'][0]
-
- if output_format == 'json':
- with open('%s/%s.json' % (outdir, self.name), "w") as fh:
- fh.write(simplejson.dumps(desc, indent=4))
- elif output_format == 'yaml':
- with open('%s/%s.yaml' % (outdir, self.name), "w") as fh:
- fh.write(yaml.dump(desc, default_flow_style=False))
- elif output_format == 'xml':
- # Converting from dict to xml does not provide the
- # required output. So using the PBCM to_xml and then
- # printing only from the catalog tag.
+ if output_format == 'json':
+ with open('%s/%s.json' % (outdir, self.name), "w") as fh:
+ fh.write(self.descriptor.to_json(model))
+ elif output_format.strip() == 'xml':
with open('%s/%s.xml' % (outdir, self.name), "w") as fh:
- proj = self.descriptor.to_xml_v2(model)
- dom = parseString(proj)
- desc = dom.getElementsByTagName("vnfd:vnfd-catalog")
- if not desc:
- desc = dom.getElementsByTagName("nsd:nsd-catalog")
- fh.write(desc[0].toprettyxml())
+ fh.write(self.descriptor.to_xml_v2(model))
+ elif output_format.strip() == 'yaml':
+ with open('%s/%s.yaml' % (outdir, self.name), "w") as fh:
+ fh.write(self.descriptor.to_yaml(model))
else:
raise Exception("Invalid output format for the descriptor")
def compose(self, image_name, cloud_init="", cloud_init_file="", endpoint=None, mon_params=[],
mon_port=8888, mgmt_port=8888, num_vlr_count=1, num_ivlr_count=1,
num_vms=1, image_md5sum=None, mano_ut=False):
- self.descriptor = RwVnfdYang.YangData_RwProject_Project_VnfdCatalog()
+ self.descriptor = RwVnfdYang.YangData_Vnfd_VnfdCatalog()
self.id = str(uuid.uuid1())
vnfd = self.descriptor.vnfd.add()
vnfd.id = self.id
cp.name = '%s/cp%d' % (self.name, i)
if endpoint is not None:
- endp = VnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd_HttpEndpoint(
+ endp = VnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd_HttpEndpoint(
path=endpoint, port=mon_port, polling_interval_secs=2
)
vnfd.http_endpoint.append(endp)
# Monitoring params
for monp_dict in mon_params:
- monp = VnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd_MonitoringParam.from_dict(monp_dict)
+ monp = VnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd_MonitoringParam.from_dict(monp_dict)
monp.http_endpoint_ref = endpoint
vnfd.monitoring_param.append(monp)
dirpath = "%s/%s" % (outdir, self.name)
if not os.path.exists(dirpath):
os.makedirs(dirpath)
- super(VirtualNetworkFunction, self).write_to_file(['rw-project', 'vnfd', 'rw-vnfd'],
+ super(VirtualNetworkFunction, self).write_to_file(['vnfd', 'rw-vnfd'],
dirpath,
output_format)
self.add_scripts(outdir)
self._placement_groups.append(placement_group)
def create_mon_params(self, vnfds):
- NsdMonParam = NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd_MonitoringParam
+ NsdMonParam = NsdYang.YangData_Nsd_NsdCatalog_Nsd_MonitoringParam
param_id = 1
for vnfd_obj in vnfds:
for mon_param in vnfd_obj.vnfd.monitoring_param:
use_ns_init_conf = False
use_vnf_init_conf = False
- self.descriptor = RwNsdYang.YangData_RwProject_Project_NsdCatalog()
+ self.descriptor = RwNsdYang.YangData_Nsd_NsdCatalog()
self.id = str(uuid.uuid1())
nsd = self.descriptor.nsd.add()
self.nsd = nsd
nsd.description = 'Toy NS'
nsd.version = '1.0'
nsd.input_parameter_xpath.append(
- NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd_InputParameterXpath(
- xpath="/nsd:nsd-catalog/nsd:nsd/nsd:vendor",
+ NsdYang.YangData_Nsd_NsdCatalog_Nsd_InputParameterXpath(
+ xpath="/nsd-catalog/nsd/vendor",
)
)
vld.ip_profile_ref = 'InterVNFLink'
for cp in cpgroup:
cpref = vld.vnfd_connection_point_ref.add()
- cpref.member_vnf_index_ref = str(cp[0])
+ cpref.member_vnf_index_ref = cp[0]
cpref.vnfd_id_ref = cp[1]
cpref.vnfd_connection_point_ref = cp[2]
for member_vnfd in placement_group.vnfd_list:
member = group.member_vnfd.add()
member.vnfd_id_ref = member_vnfd.descriptor.vnfd[0].id
- member.member_vnf_index_ref = str(vnfd_index_map[member_vnfd])
+ member.member_vnf_index_ref = vnfd_index_map[member_vnfd]
# self.create_mon_params(vnfd_list)
if not os.path.exists(dirpath):
os.makedirs(dirpath)
- super(NetworkService, self).write_to_file(["rw-project", "nsd", "rw-nsd"],
+ super(NetworkService, self).write_to_file(["nsd", "rw-nsd"],
dirpath,
output_format)
import gi
gi.require_version('RwYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
-gi.require_version('RwNsdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
+gi.require_version('RwProjectNsdYang', '1.0')
from gi.repository import (
RwYang,
- RwVnfdYang,
- RwNsdYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwProjectNsdYang as RwNsdYang,
)
import rift.package.store
import gi
gi.require_version('RwYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
-gi.require_version('RwNsdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
+gi.require_version('RwProjectNsdYang', '1.0')
gi.require_version('RwProjectYang', '1.0')
from gi.repository import (
RwYang,
- RwVnfdYang,
- RwNsdYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwProjectNsdYang as RwNsdYang,
RwProjectYang,
)
if topo_node['type'] == 'VNF':
cpref = vld.vnfd_connection_point_ref.add()
cpref.from_dict(dict(
- member_vnf_index_ref=str(vnf_member_index_dict[node_key]),
+ member_vnf_index_ref=vnf_member_index_dict[node_key],
vnfd_id_ref=self.get_vnfd_id(vnf_list, topo_node['VNF model']),
#vnfd_id_ref=topo_node['VNF model'],
vnfd_connection_point_ref=node[node_key],
vnf_list = create_vnfs_from_yaml_files(args.yaml_file_hdls)
ns_list = create_ns_from_yaml_files(args.yaml_file_hdls, vnf_list)
+ # TODO (Philip): Relook at the model generation
writer = DescriptorFileWriter(
- module_list=['rw-project', 'nsd', 'rw-nsd', 'vnfd', 'rw-vnfd'],
+ module_list=['rw-project', 'project-nsd', 'rw-project-nsd', 'project-vnfd', 'rw-project-vnfd'],
output_dir=args.outdir,
output_format=args.format,
)
ietf-l2-topology.yang
ietf-network-topology.yang
ietf-network.yang
+ nsd-base.yang rw-nsd-base.yang
nsd.yang rw-nsd.yang
+ project-nsd.yang rw-project-nsd.yang
nsr.yang rw-nsr.yang
pnfd.yang
rw-topology.yang
vld.yang rw-vld.yang
vlr.yang rw-vlr.yang
+ vnfd-base.yang rw-vnfd-base.yang
vnfd.yang rw-vnfd.yang
+ project-vnfd.yang rw-project-vnfd.yang
vnfr.yang rw-vnfr.yang
vnffgd.yang
)
--- /dev/null
+
+/*
+ *
+ * Copyright 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.
+ *
+ *
+ */
+
+module nsd-base
+{
+ namespace "http://riftio.com/ns/riftware-1.0/nsd-base";
+ prefix "nsd-base";
+
+ import rw-pb-ext {
+ prefix "rwpb";
+ }
+
+ import vld {
+ prefix "vld";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ the Network Service Descriptor (NSD)
+ common groupings";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ typedef scaling-trigger {
+ type enumeration {
+ enum pre-scale-in {
+ value 1;
+ }
+ enum post-scale-in {
+ value 2;
+ }
+ enum pre-scale-out {
+ value 3;
+ }
+ enum post-scale-out {
+ value 4;
+ }
+ }
+ }
+
+ typedef scaling-policy-type {
+ type enumeration {
+ enum manual {
+ value 1;
+ }
+ enum automatic {
+ value 2;
+ }
+ }
+ }
+
+ typedef scaling-criteria-operation {
+ type enumeration {
+ enum AND {
+ value 1;
+ }
+ enum OR {
+ value 2;
+ }
+ }
+ }
+
+ 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 paramter";
+ type string;
+ }
+ }
+
+ grouping nsd-descriptor-common {
+ leaf id {
+ description "Identifier for the NSD.";
+ type string;
+ }
+
+ leaf name {
+ description "NSD name.";
+ mandatory true;
+ type string;
+ }
+
+ leaf short-name {
+ description "NSD short name.";
+ type string;
+ }
+
+ leaf vendor {
+ description "Vendor of the NSD.";
+ type string;
+ }
+
+ leaf logo {
+ description
+ "File path for the vendor specific logo. For example icons/mylogo.png.
+ The logo should be part of the network service";
+ type string;
+ }
+
+ leaf description {
+ description "Description of the NSD.";
+ type string;
+ }
+
+ leaf version {
+ description "Version of the NSD";
+ type string;
+ }
+
+ list connection-point {
+ description
+ "List for external connection points.
+ Each NS has one or more external connection
+ points. As the name implies that external
+ connection points are used for connecting
+ the NS to other NS or to external networks.
+ Each NS exposes these connection points to
+ the orchestrator. The orchestrator can
+ construct network service chains by
+ connecting the connection points between
+ different NS.";
+
+ key "name";
+ leaf name {
+ description
+ "Name of the NS connection point.";
+ type string;
+ }
+
+ leaf type {
+ description
+ "Type of the connection point.";
+ type manotypes:connection-point-type;
+ }
+ }
+
+ list scaling-group-descriptor {
+ description
+ "scaling group descriptor within this network service.
+ The scaling group defines a group of VNFs,
+ and the ratio of VNFs in the network service
+ that is used as target for scaling action";
+
+ key "name";
+
+ leaf name {
+ description "Name of this scaling group.";
+ type string;
+ }
+
+ list scaling-policy {
+
+ key "name";
+
+ leaf name {
+ description
+ "Name of the scaling policy";
+ type string;
+ }
+
+ leaf scaling-type {
+ description
+ "Type of scaling";
+ type scaling-policy-type;
+ }
+
+ leaf enabled {
+ description
+ "Specifies if the scaling policy can be applied";
+ type boolean;
+ default true;
+ }
+
+ leaf scale-in-operation-type {
+ description
+ "Operation to be applied to check between scaling criterias to
+ check if the scale in threshold condition has been met.
+ Defaults to AND";
+ type scaling-criteria-operation;
+ default AND;
+ }
+
+ leaf scale-out-operation-type {
+ description
+ "Operation to be applied to check between scaling criterias to
+ check if the scale out threshold condition has been met.
+ Defauls to OR";
+ type scaling-criteria-operation;
+ default OR;
+ }
+
+ leaf threshold-time {
+ description
+ "The duration for which the criteria must hold true";
+ type uint32;
+ mandatory true;
+ }
+
+ leaf cooldown-time {
+ description
+ "The duration after a scaling-in/scaling-out action has been
+ triggered, for which there will be no further optional";
+ type uint32;
+ mandatory true;
+ }
+
+ list scaling-criteria {
+ description
+ "list of conditions to be met for generating scaling
+ requests";
+ key "name";
+
+ leaf name {
+ type string;
+ }
+
+ leaf scale-in-threshold {
+ description
+ "Value below which scale-in requests are generated";
+ type uint64;
+ }
+
+ leaf scale-out-threshold {
+ description
+ "Value above which scale-out requests are generated";
+ type uint64;
+ }
+
+ leaf ns-monitoring-param-ref {
+ description
+ "Reference to the NS level monitoring parameter
+ that is aggregated";
+ type leafref {
+ path "../../../../monitoring-param/id";
+ }
+ }
+ }
+ }
+
+ list vnfd-member {
+ description "List of VNFs in this scaling group";
+ key "member-vnf-index-ref";
+
+ leaf member-vnf-index-ref {
+ description "member VNF index of this member VNF";
+ type leafref {
+ path "../../../constituent-vnfd/member-vnf-index";
+ }
+ }
+
+ leaf count {
+ description
+ "count of this member VNF within this scaling group.
+ The count allows to define the number of instances
+ when a scaling action targets this scaling group";
+ type uint32;
+ default 1;
+ }
+ }
+
+ leaf min-instance-count {
+ description
+ "Minimum instances of the scaling group which are allowed.
+ These instances are created by default when the network service
+ is instantiated.";
+ type uint32;
+ default 0;
+ }
+
+ leaf max-instance-count {
+ description
+ "Maximum instances of this scaling group that are allowed
+ in a single network service. The network service scaling
+ will fail, when the number of service group instances
+ exceed the max-instance-count specified.";
+ type uint32;
+ default 10;
+ }
+
+ list scaling-config-action {
+ description "List of scaling config actions";
+ key "trigger";
+
+ leaf trigger {
+ description "scaling trigger";
+ type scaling-trigger;
+ }
+
+ leaf ns-config-primitive-name-ref {
+ description "Reference to the NS config name primitive";
+ type leafref {
+ path "../../../service-primitive/name";
+ }
+ }
+ }
+ }
+
+
+ list vnffgd {
+ description
+ "List of VNF Forwarding Graph Descriptors (VNFFGD).";
+
+ key "id";
+
+ leaf id {
+ description
+ "Identifier for the VNFFGD.";
+ type string;
+ }
+
+ leaf name {
+ description
+ "VNFFGD name.";
+ type string;
+ }
+
+ leaf short-name {
+ description
+ "Short name for VNFFGD for UI";
+ type string;
+ }
+
+ leaf vendor {
+ description "Provider of the VNFFGD.";
+ type string;
+ }
+
+ leaf description {
+ description "Description of the VNFFGD.";
+ type string;
+ }
+
+ leaf version {
+ description "Version of the VNFFGD";
+ type string;
+ }
+
+ list rsp {
+ description
+ "List of Rendered Service Paths (RSP).";
+
+ key "id";
+
+ leaf id {
+ description
+ "Identifier for the RSP.";
+ type string;
+ }
+
+ leaf name {
+ description
+ "RSP name.";
+ type string;
+ }
+
+ list vnfd-connection-point-ref {
+ description
+ "A list of references to connection points.";
+ key "member-vnf-index-ref";
+
+ leaf member-vnf-index-ref {
+ description "Reference to member-vnf within constituent-vnfds";
+ type leafref {
+ path "../../../../constituent-vnfd/member-vnf-index";
+ }
+ }
+
+ leaf order {
+ type uint8;
+ description
+ "A number that denotes the order of a VNF in a chain";
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type leafref {
+ path "../../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
+ }
+
+ leaf vnfd-connection-point-ref {
+ description
+ "A reference to a connection point name
+ in a vnfd. This is a leafref to path:
+ /vnfd:vnfd-catalog/vnfd:vnfd
+ + [vnfd:id = current()/../nsd:vnfd-id-ref]
+ + /vnfd:connection-point/vnfd:name
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ // TODO: Keeping as string as this needs to be
+ // diffenent lvel based of if it is nsd-catalog or
+ // in nsr.
+ // type leafref {
+ // path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
+ // "[vnfd:id = current()/../vnfd-id-ref]/" +
+ // "vnfd:connection-point/vnfd:name";
+ // }
+ type string;
+ }
+ }
+ } //rsp
+
+ list classifier {
+ description
+ "List of classifier rules.";
+
+ key "id";
+
+ leaf id {
+ description
+ "Identifier for the classifier rule.";
+ type string;
+ }
+
+ leaf name {
+ description
+ "Name of the classifier.";
+ type string;
+ }
+
+ leaf rsp-id-ref {
+ description
+ "A reference to the RSP.";
+ type leafref {
+ path "../../rsp/id";
+ }
+ }
+
+ leaf member-vnf-index-ref {
+ description "Reference to member-vnf within constituent-vnfds";
+ type leafref {
+ path "../../../constituent-vnfd/member-vnf-index";
+ }
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type leafref {
+ path "../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
+ }
+
+ leaf vnfd-connection-point-ref {
+ description
+ "A reference to a connection point name
+ in a vnfd. This is a leafref to path:
+ /vnfd:vnfd-catalog/vnfd:vnfd
+ + [vnfd:id = current()/../nsd:vnfd-id-ref]
+ + /vnfd:connection-point/vnfd:name
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ // TODO: Keeping as string as this needs to be
+ // diffenent lvel based of if it is nsd-catalog or
+ // in nsr.
+ // type leafref {
+ // path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
+ // "[vnfd:id = current()/../vnfd-id-ref]/" +
+ // "vnfd:connection-point/vnfd:name";
+ // }
+ type string;
+ }
+
+ list match-attributes {
+ description
+ "List of match attributes.";
+
+ key "id";
+
+ leaf id {
+ description
+ "Identifier for the classifier match attribute rule.";
+ type string;
+ }
+
+ leaf ip-proto {
+ description
+ "IP Protocol.";
+ type uint8;
+ }
+
+ leaf source-ip-address {
+ description
+ "Source IP address.";
+ type inet:ip-address;
+ }
+
+ leaf destination-ip-address {
+ description
+ "Destination IP address.";
+ type inet:ip-address;
+ }
+
+ leaf source-port {
+ description
+ "Source port number.";
+ type inet:port-number;
+ }
+
+ leaf destination-port {
+ description
+ "Destination port number.";
+ type inet:port-number;
+ }
+ //TODO: Add more match criteria
+ } //match-attributes
+ } // classifier
+ } // vnffgd
+
+ uses manotypes:ip-profile-list;
+
+ uses manotypes:ns-service-primitive;
+
+ list initial-config-primitive {
+ rwpb:msg-new NsdInitialConfigPrimitive;
+ description
+ "Initial set of configuration primitives for NSD.";
+ key "seq";
+
+ uses manotypes:initial-config;
+ }
+
+ uses manotypes:input-parameter-xpath;
+
+ list parameter-pool {
+ description
+ "Pool of parameter values which must be
+ pulled from during configuration";
+ key "name";
+
+ leaf name {
+ description
+ "Name of the configuration value pool";
+ type string;
+ }
+
+ container range {
+ description
+ "Create a range of values to populate the pool with";
+
+ leaf start-value {
+ description
+ "Generated pool values start at this value";
+ type uint32;
+ mandatory true;
+ }
+
+ leaf end-value {
+ description
+ "Generated pool values stop at this value";
+ type uint32;
+ mandatory true;
+ }
+ }
+ }
+
+ list key-pair {
+ key "name";
+ description "Used to configure the list of public keys to be injected as part
+ of ns instantiation";
+
+ leaf name {
+ description "Name of this key pair";
+ type string;
+ }
+
+ leaf key {
+ description "Key associated with this key pair";
+ type string;
+ }
+ }
+
+ list user {
+ key "name";
+ description "List of users to be added through cloud-config";
+
+ leaf name {
+ description "Name of the user ";
+ type string;
+ }
+
+ leaf user-info {
+ description "The user name's real name";
+ type string;
+ }
+
+ list key-pair {
+ key "name";
+ description "Used to configure the list of public keys to be injected as part
+ of ns instantiation";
+
+ leaf name {
+ description "Name of this key pair";
+ type string;
+ }
+
+ leaf key {
+ description "Key associated with this key pair";
+ type string;
+ }
+ }
+ }
+ }
+
+ grouping nsd-vld-common {
+ /* Still having issues modelling this,
+ see the comments under vnfd-connection-point-ref
+ */
+ description
+ "List of Virtual Link Descriptors.";
+
+ leaf id {
+ description
+ "Identifier for the VLD.";
+ type string;
+ }
+
+ leaf name {
+ description
+ "Virtual Link Descriptor (VLD) name.";
+ type string;
+ }
+
+ leaf short-name {
+ description
+ "Short name for VLD for UI";
+ type string;
+ }
+
+ leaf vendor {
+ description "Provider of the VLD.";
+ type string;
+ }
+
+ leaf description {
+ description "Description of the VLD.";
+ type string;
+ }
+
+ leaf version {
+ description "Version of the VLD";
+ type string;
+ }
+
+ leaf type {
+ type manotypes:virtual-link-type;
+ }
+
+ leaf root-bandwidth {
+ description
+ "For ELAN this is the aggregate bandwidth.";
+ type uint64;
+ }
+
+ leaf leaf-bandwidth {
+ description
+ "For ELAN this is the bandwidth of branches.";
+ type uint64;
+ }
+
+ // replicate for pnfd container here
+ uses manotypes:provider-network;
+
+ leaf mgmt-network {
+ description "Flag indicating whether this network is a VIM management network";
+ type boolean;
+ default false;
+ }
+
+ choice init-params {
+ description "Extra parameters for VLD instantiation";
+
+ case vim-network-ref {
+ leaf vim-network-name {
+ description
+ "Name of network in VIM account. This is used to indicate
+ pre-provisioned network name in cloud account.";
+ type string;
+ }
+ }
+
+ case vim-network-profile {
+ leaf ip-profile-ref {
+ description "Named reference to IP-profile object";
+ type string;
+ }
+ }
+
+ }
+ }
+
+ grouping monitoring-param-common {
+ description
+ "List of monitoring parameters from VNF's that should be
+ propogated up into NSR";
+
+ leaf id {
+ type string;
+ }
+
+ leaf name {
+ type string;
+ }
+
+ uses manotypes:monitoring-param-value;
+ uses manotypes:monitoring-param-ui-data;
+ uses manotypes:monitoring-param-aggregation;
+ }
+}
namespace "urn:ietf:params:xml:ns:yang:nfvo:nsd";
prefix "nsd";
- import rw-pb-ext {
- prefix "rwpb";
- }
-
- import vld {
- prefix "vld";
- }
-
- import vnfd {
- prefix "vnfd";
- }
-
- import ietf-inet-types {
- prefix "inet";
- }
-
import ietf-yang-types {
prefix "yang";
}
- import mano-types {
- prefix "manotypes";
- }
-
- import rw-project {
- prefix "rw-project";
- }
-
- revision 2017-02-08 {
- description
- "Update model to support projects.";
- }
-
- revision 2014-10-27 {
- description
- "Initial revision. This YANG file defines
- the Network Service Descriptor (NSD)";
- reference
- "Derived from earlier versions of base YANG files";
- }
-
- typedef scaling-trigger {
- type enumeration {
- enum pre-scale-in {
- value 1;
- }
- enum post-scale-in {
- value 2;
- }
- enum pre-scale-out {
- value 3;
- }
- enum post-scale-out {
- value 4;
- }
- }
- }
-
- typedef scaling-policy-type {
- type enumeration {
- enum manual {
- value 1;
- }
- enum automatic {
- value 2;
- }
- }
- }
-
- typedef scaling-criteria-operation {
- type enumeration {
- enum AND {
- value 1;
- }
- enum OR {
- value 2;
- }
- }
- }
-
- 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 paramter";
- type string;
- }
- }
-
- grouping nsd-descriptor-common {
- leaf id {
- description "Identifier for the NSD.";
- type string;
- }
-
- leaf name {
- description "NSD name.";
- mandatory true;
- type string;
- }
-
- leaf short-name {
- description "NSD short name.";
- type string;
- }
-
- leaf vendor {
- description "Vendor of the NSD.";
- type string;
- }
-
- leaf logo {
- description
- "File path for the vendor specific logo. For example icons/mylogo.png.
- The logo should be part of the network service";
- type string;
- }
-
- leaf description {
- description "Description of the NSD.";
- type string;
- }
-
- leaf version {
- description "Version of the NSD";
- type string;
- }
-
- list connection-point {
- description
- "List for external connection points.
- Each NS has one or more external connection
- points. As the name implies that external
- connection points are used for connecting
- the NS to other NS or to external networks.
- Each NS exposes these connection points to
- the orchestrator. The orchestrator can
- construct network service chains by
- connecting the connection points between
- different NS.";
-
- key "name";
- leaf name {
- description
- "Name of the NS connection point.";
- type string;
- }
-
- leaf type {
- description
- "Type of the connection point.";
- type manotypes:connection-point-type;
- }
- }
-
- list scaling-group-descriptor {
- description
- "scaling group descriptor within this network service.
- The scaling group defines a group of VNFs,
- and the ratio of VNFs in the network service
- that is used as target for scaling action";
-
- key "name";
-
- leaf name {
- description "Name of this scaling group.";
- type string;
- }
-
- list scaling-policy {
-
- key "name";
-
- leaf name {
- description
- "Name of the scaling policy";
- type string;
- }
-
- leaf scaling-type {
- description
- "Type of scaling";
- type scaling-policy-type;
- }
-
- leaf enabled {
- description
- "Specifies if the scaling policy can be applied";
- type boolean;
- default true;
- }
-
- leaf scale-in-operation-type {
- description
- "Operation to be applied to check between scaling criterias to
- check if the scale in threshold condition has been met.
- Defaults to AND";
- type scaling-criteria-operation;
- default AND;
- }
-
- leaf scale-out-operation-type {
- description
- "Operation to be applied to check between scaling criterias to
- check if the scale out threshold condition has been met.
- Defauls to OR";
- type scaling-criteria-operation;
- default OR;
- }
-
- leaf threshold-time {
- description
- "The duration for which the criteria must hold true";
- type uint32;
- mandatory true;
- }
-
- leaf cooldown-time {
- description
- "The duration after a scaling-in/scaling-out action has been
- triggered, for which there will be no further optional";
- type uint32;
- mandatory true;
- }
-
- list scaling-criteria {
- description
- "list of conditions to be met for generating scaling
- requests";
- key "name";
-
- leaf name {
- type string;
- }
-
- leaf scale-in-threshold {
- description
- "Value below which scale-in requests are generated";
- type uint64;
- }
-
- leaf scale-out-threshold {
- description
- "Value above which scale-out requests are generated";
- type uint64;
- }
-
- leaf ns-monitoring-param-ref {
- description
- "Reference to the NS level monitoring parameter
- that is aggregated";
- type leafref {
- path "../../../../monitoring-param/id";
- }
- }
- }
- }
-
- list vnfd-member {
- description "List of VNFs in this scaling group";
- key "member-vnf-index-ref";
-
- leaf member-vnf-index-ref {
- description "member VNF index of this member VNF";
- type leafref {
- path "../../../constituent-vnfd/member-vnf-index";
- }
- }
-
- leaf count {
- description
- "count of this member VNF within this scaling group.
- The count allows to define the number of instances
- when a scaling action targets this scaling group";
- type uint32;
- default 1;
- }
- }
-
- leaf min-instance-count {
- description
- "Minimum instances of the scaling group which are allowed.
- These instances are created by default when the network service
- is instantiated.";
- type uint32;
- default 0;
- }
-
- leaf max-instance-count {
- description
- "Maximum instances of this scaling group that are allowed
- in a single network service. The network service scaling
- will fail, when the number of service group instances
- exceed the max-instance-count specified.";
- type uint32;
- default 10;
- }
-
- list scaling-config-action {
- description "List of scaling config actions";
- key "trigger";
-
- leaf trigger {
- description "scaling trigger";
- type scaling-trigger;
- }
-
- leaf ns-config-primitive-name-ref {
- description "Reference to the NS config name primitive";
- type leafref {
- path "../../../service-primitive/name";
- }
- }
- }
- }
-
-
- list vnffgd {
- description
- "List of VNF Forwarding Graph Descriptors (VNFFGD).";
-
- key "id";
-
- leaf id {
- description
- "Identifier for the VNFFGD.";
- type string;
- }
-
- leaf name {
- description
- "VNFFGD name.";
- type string;
- }
-
- leaf short-name {
- description
- "Short name for VNFFGD for UI";
- type string;
- }
-
- leaf vendor {
- description "Provider of the VNFFGD.";
- type string;
- }
-
- leaf description {
- description "Description of the VNFFGD.";
- type string;
- }
-
- leaf version {
- description "Version of the VNFFGD";
- type string;
- }
-
- list rsp {
- description
- "List of Rendered Service Paths (RSP).";
-
- key "id";
-
- leaf id {
- description
- "Identifier for the RSP.";
- type string;
- }
-
- leaf name {
- description
- "RSP name.";
- type string;
- }
-
- list vnfd-connection-point-ref {
- description
- "A list of references to connection points.";
- key "member-vnf-index-ref";
-
- leaf member-vnf-index-ref {
- description "Reference to member-vnf within constituent-vnfds";
- type leafref {
- path "../../../../constituent-vnfd/member-vnf-index";
- }
- }
-
- leaf order {
- type uint8;
- description
- "A number that denotes the order of a VNF in a chain";
- }
-
- leaf vnfd-id-ref {
- description
- "A reference to a vnfd. This is a
- leafref to path:
- ../../../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resovled this will switched to use
- leafref";
- type leafref {
- path "../../../../constituent-vnfd" +
- "[member-vnf-index = current()/../member-vnf-index-ref]" +
- "/vnfd-id-ref";
- }
- }
-
- leaf vnfd-connection-point-ref {
- description
- "A reference to a connection point name
- in a vnfd. This is a leafref to path:
- /vnfd:vnfd-catalog/vnfd:vnfd
- + [vnfd:id = current()/../nsd:vnfd-id-ref]
- + /vnfd:connection-point/vnfd:name
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resovled this will switched to use
- leafref";
- // TODO: Keeping as string as this needs to be
- // diffenent lvel based of if it is nsd-catalog or
- // in nsr.
- // type leafref {
- // path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
- // "[vnfd:id = current()/../vnfd-id-ref]/" +
- // "vnfd:connection-point/vnfd:name";
- // }
- type string;
- }
- }
- } //rsp
-
- list classifier {
- description
- "List of classifier rules.";
-
- key "id";
-
- leaf id {
- description
- "Identifier for the classifier rule.";
- type string;
- }
-
- leaf name {
- description
- "Name of the classifier.";
- type string;
- }
-
- leaf rsp-id-ref {
- description
- "A reference to the RSP.";
- type leafref {
- path "../../rsp/id";
- }
- }
-
- leaf member-vnf-index-ref {
- description "Reference to member-vnf within constituent-vnfds";
- type leafref {
- path "../../../constituent-vnfd/member-vnf-index";
- }
- }
-
- leaf vnfd-id-ref {
- description
- "A reference to a vnfd. This is a
- leafref to path:
- ../../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resovled this will switched to use
- leafref";
- type leafref {
- path "../../../constituent-vnfd" +
- "[member-vnf-index = current()/../member-vnf-index-ref]" +
- "/vnfd-id-ref";
- }
- }
-
- leaf vnfd-connection-point-ref {
- description
- "A reference to a connection point name
- in a vnfd. This is a leafref to path:
- /vnfd:vnfd-catalog/vnfd:vnfd
- + [vnfd:id = current()/../nsd:vnfd-id-ref]
- + /vnfd:connection-point/vnfd:name
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resovled this will switched to use
- leafref";
- // TODO: Keeping as string as this needs to be
- // diffenent lvel based of if it is nsd-catalog or
- // in nsr.
- // type leafref {
- // path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
- // "[vnfd:id = current()/../vnfd-id-ref]/" +
- // "vnfd:connection-point/vnfd:name";
- // }
- type string;
- }
-
- list match-attributes {
- description
- "List of match attributes.";
-
- key "id";
-
- leaf id {
- description
- "Identifier for the classifier match attribute rule.";
- type string;
- }
-
- leaf ip-proto {
- description
- "IP Protocol.";
- type uint8;
- }
-
- leaf source-ip-address {
- description
- "Source IP address.";
- type inet:ip-address;
- }
-
- leaf destination-ip-address {
- description
- "Destination IP address.";
- type inet:ip-address;
- }
-
- leaf source-port {
- description
- "Source port number.";
- type inet:port-number;
- }
-
- leaf destination-port {
- description
- "Destination port number.";
- type inet:port-number;
- }
- //TODO: Add more match criteria
- } //match-attributes
- } // classifier
- } // vnffgd
-
- uses manotypes:ip-profile-list;
-
- uses manotypes:ns-service-primitive;
-
- list initial-config-primitive {
- rwpb:msg-new NsdInitialConfigPrimitive;
- description
- "Initial set of configuration primitives for NSD.";
- key "seq";
-
- uses manotypes:initial-config;
- }
-
- uses manotypes:input-parameter-xpath;
-
- list parameter-pool {
- description
- "Pool of parameter values which must be
- pulled from during configuration";
- key "name";
-
- leaf name {
- description
- "Name of the configuration value pool";
- type string;
- }
-
- container range {
- description
- "Create a range of values to populate the pool with";
-
- leaf start-value {
- description
- "Generated pool values start at this value";
- type uint32;
- mandatory true;
- }
-
- leaf end-value {
- description
- "Generated pool values stop at this value";
- type uint32;
- mandatory true;
- }
- }
- }
-
- list key-pair {
- key "name";
- description "Used to configure the list of public keys to be injected as part
- of ns instantiation";
-
- leaf name {
- description "Name of this key pair";
- type string;
- }
-
- leaf key {
- description "Key associated with this key pair";
- type string;
- }
- }
-
- list user {
- key "name";
- description "List of users to be added through cloud-config";
-
- leaf name {
- description "Name of the user ";
- type string;
- }
-
- leaf user-info {
- description "The user name's real name";
- type string;
- }
-
- list key-pair {
- key "name";
- description "Used to configure the list of public keys to be injected as part
- of ns instantiation";
-
- leaf name {
- description "Name of this key pair";
- type string;
- }
-
- leaf key {
- description "Key associated with this key pair";
- type string;
- }
- }
- }
+ import vnfd {
+ prefix "vnfd";
}
- grouping nsd-vld-common {
- /* Still having issues modelling this,
- see the comments under vnfd-connection-point-ref
- */
- description
- "List of Virtual Link Descriptors.";
-
- leaf id {
- description
- "Identifier for the VLD.";
- type string;
- }
-
- leaf name {
- description
- "Virtual Link Descriptor (VLD) name.";
- type string;
- }
-
- leaf short-name {
- description
- "Short name for VLD for UI";
- type string;
- }
-
- leaf vendor {
- description "Provider of the VLD.";
- type string;
- }
-
- leaf description {
- description "Description of the VLD.";
- type string;
- }
+ import nsd-base {
+ prefix "nsd-base";
+ }
- leaf version {
- description "Version of the VLD";
- type string;
- }
+ import mano-types {
+ prefix "manotypes";
+ }
- leaf type {
- type manotypes:virtual-link-type;
- }
+ revision 2017-02-28 {
+ description
+ "Update model to support projects.";
+ }
- leaf root-bandwidth {
- description
- "For ELAN this is the aggregate bandwidth.";
- type uint64;
- }
+ revision 2014-10-27 {
+ description
+ "Initial revision. This YANG file defines
+ the Network Service Descriptor (NSD)";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
- leaf leaf-bandwidth {
+ grouping nsd-constituent-vnfd {
+ list constituent-vnfd {
description
- "For ELAN this is the bandwidth of branches.";
- type uint64;
- }
-
- // replicate for pnfd container here
- uses manotypes:provider-network;
-
- leaf mgmt-network {
- description "Flag indicating whether this network is a VIM management network";
- type boolean;
- default false;
- }
+ "List of VNFDs that are part of this
+ network service.";
- choice init-params {
- description "Extra parameters for VLD instantiation";
+ key "member-vnf-index";
- case vim-network-ref {
- leaf vim-network-name {
- description
- "Name of network in VIM account. This is used to indicate
- pre-provisioned network name in cloud account.";
- type string;
- }
+ leaf member-vnf-index {
+ description
+ "Identifier/index for the VNFD. This separate id
+ is required to ensure that multiple VNFs can be
+ part of single NS";
+ type uint64;
}
- case vim-network-profile {
- leaf ip-profile-ref {
- description "Named reference to IP-profile object";
- type string;
+ leaf vnfd-id-ref {
+ description
+ "Identifier for the VNFD.";
+ type leafref {
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
}
}
+ leaf start-by-default {
+ description
+ "VNFD is started as part of the NS instantiation";
+ type boolean;
+ default true;
+ }
}
}
key "id";
- uses nsd-vld-common;
+ uses nsd-base:nsd-vld-common;
list vnfd-connection-point-ref {
description
description
"A reference to a vnfd. This is a
leafref to path:
- ../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
+ ../../constituent-vnfd
+ + [id = current()/../id-ref]
+ + /vnfd-id-ref
NOTE: An issue with confd is preventing the
use of xpath. Seems to be an issue with leafref
to leafref, whose target is in a different module.
leaf vnfd-connection-point-ref {
description "A reference to a connection point name";
type leafref {
- path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
+ path "/vnfd:vnfd-catalog/vnfd:vnfd" +
"[vnfd:id = current()/../vnfd-id-ref]/" +
"vnfd:connection-point/vnfd:name";
}
}
}
- grouping nsr-nsd-vld {
- list vld {
-
- key "id";
-
- uses nsd-vld-common;
-
- list vnfd-connection-point-ref {
- description
- "A list of references to connection points.";
- key "member-vnf-index-ref vnfd-connection-point-ref";
-
- leaf member-vnf-index-ref {
- description "Reference to member-vnf within constituent-vnfds";
- // TODO (Philip): Fix this
- // type leafref {
- // path "../../../constituent-vnfd/member-vnf-index";
- // }
- type uint64;
- }
-
- leaf vnfd-id-ref {
- description
- "A reference to a vnfd. This is a
- leafref to path:
- ../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resovled this will switched to use
- leafref";
- type string;
- }
-
- leaf vnfd-connection-point-ref {
- description "A reference to a connection point name";
- // TODO (Philip): Fix this
- // type leafref {
- // path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
- // "[vnfd:id = current()/../vnfd-id-ref]/" +
- // "vnfd:connection-point/vnfd:name";
- // }
- type string;
- }
- }
- }
- }
-
- grouping nsd-constituent-vnfd {
- list constituent-vnfd {
+ grouping nsd-vnf-dependency {
+ list vnf-dependency {
description
- "List of VNFDs that are part of this
- network service.";
-
- key "member-vnf-index";
-
- leaf member-vnf-index {
- description
- "Identifier/index for the VNFD. This separate id
- is required to ensure that multiple VNFs can be
- part of single NS";
- type uint64;
- }
-
- leaf vnfd-id-ref {
- description
- "Identifier for the VNFD.";
+ "List of VNF dependencies.";
+ key vnf-source-ref;
+ leaf vnf-source-ref {
type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
}
}
-
- leaf start-by-default {
- description
- "VNFD is started as part of the NS instantiation";
- type boolean;
- default true;
- }
- }
- }
-
- grouping nsr-nsd-constituent-vnfd {
- list constituent-vnfd {
- description
- "List of VNFDs that are part of this
- network service.";
-
- key "member-vnf-index";
-
- leaf member-vnf-index {
- description
- "Identifier/index for the VNFD. This separate id
- is required to ensure that multiple VNFs can be
- part of single NS";
- type uint64;
- }
-
- leaf vnfd-id-ref {
- description
- "Identifier for the VNFD.";
- // TODO (Philip): Fix this
- // type leafref {
- // path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- // }
- type string;
- }
-
- leaf start-by-default {
+ leaf vnf-depends-on-ref {
description
- "VNFD is started as part of the NS instantiation";
- type boolean;
- default true;
+ "Reference to VNF that sorce VNF depends.";
+ type leafref {
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ }
}
}
}
description
"Identifier for the VNFD.";
type leafref {
- path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
}
}
}
}
}
- grouping nsr-nsd-placement-groups {
- list placement-groups {
- description "List of placement groups at NS level";
-
- key "name";
- uses manotypes:placement-group-info;
-
- list member-vnfd {
- description
- "List of VNFDs that are part of this placement group";
-
- key "member-vnf-index-ref";
-
- leaf member-vnf-index-ref {
- description "member VNF index of this member VNF";
- // TODO (Philip): Fix this
- // type leafref {
- // path "../../../constituent-vnfd/member-vnf-index";
- // }
- type uint64;
- }
-
- leaf vnfd-id-ref {
- description
- "Identifier for the VNFD.";
- // TODO (Philip): Fix this
- // type leafref {
- // path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- // }
- type string;
- }
- }
- }
- }
-
- grouping nsd-vnf-dependency {
- list vnf-dependency {
- description
- "List of VNF dependencies.";
- key vnf-source-ref;
- leaf vnf-source-ref {
- type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- }
- }
- leaf vnf-depends-on-ref {
- description
- "Reference to VNF that sorce VNF depends.";
- type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- }
- }
- }
- }
-
- grouping nsr-nsd-vnf-dependency {
- list vnf-dependency {
- description
- "List of VNF dependencies.";
- key vnf-source-ref;
- leaf vnf-source-ref {
- type leafref {
- path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- }
- }
- leaf vnf-depends-on-ref {
- description
- "Reference to VNF that sorce VNF depends.";
- type leafref {
- path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
- }
- }
- }
- }
-
- grouping monitoring-param-common {
- // list monitoring-param {
- description
- "List of monitoring parameters from VNF's that should be
- propogated up into NSR";
- leaf id {
- type string;
- }
-
- leaf name {
- type string;
- }
-
- uses manotypes:monitoring-param-value;
- uses manotypes:monitoring-param-ui-data;
- uses manotypes:monitoring-param-aggregation;
- }
-
grouping nsd-monitoring-param {
list monitoring-param {
- key "id";
-
- uses monitoring-param-common;
-
- list vnfd-monitoring-param {
- description "A list of VNFD monitoring params";
- key "vnfd-id-ref vnfd-monitoring-param-ref";
-
- leaf vnfd-id-ref {
- description
- "A reference to a vnfd. This is a
- leafref to path:
- ../../../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
- NOTE: An issue with confd is preventing the
- use of xpath. Seems to be an issue with leafref
- to leafref, whose target is in a different module.
- Once that is resolved this will switched to use
- leafref";
-
- type yang:uuid;
- }
-
- leaf vnfd-monitoring-param-ref {
- description "A reference to the VNFD monitoring param";
- type leafref {
- path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd"
- + "[vnfd:id = current()/../vnfd-id-ref]"
- + "/vnfd:monitoring-param/vnfd:id";
- }
- }
-
- leaf-list member-vnf-index-ref {
- description
- "Optional reference to member-vnf within constituent-vnfds";
- type uint64;
- }
- }
- }
- }
-
- grouping nsr-nsd-monitoring-param {
- list monitoring-param {
- key "id";
+ key id;
- uses monitoring-param-common;
+ uses nsd-base:monitoring-param-common;
list vnfd-monitoring-param {
description "A list of VNFD monitoring params";
leaf vnfd-monitoring-param-ref {
description "A reference to the VNFD monitoring param";
type leafref {
- path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd"
+ path "/vnfd:vnfd-catalog/vnfd:vnfd"
+ "[vnfd:id = current()/../vnfd-id-ref]"
+ "/vnfd:monitoring-param/vnfd:id";
}
}
}
+ container nsd-catalog {
- augment "/rw-project:project" {
- container nsd-catalog {
+ list nsd {
+ key id;
- list nsd {
- key "id";
+ uses nsd-base:nsd-descriptor-common;
- uses nsd-descriptor-common;
+ uses nsd-vld;
- uses nsd-vld;
+ uses nsd-constituent-vnfd;
- uses nsd-constituent-vnfd;
+ uses nsd-placement-groups;
- uses nsd-placement-groups;
+ uses nsd-vnf-dependency;
- uses nsd-vnf-dependency;
-
- uses nsd-monitoring-param;
- }
+ uses nsd-monitoring-param;
}
}
}
prefix "vld";
}
- import nsd {
- prefix "nsd";
+ import nsd-base {
+ prefix "nsd-base";
}
- import vnfd {
- prefix "vnfd";
+ import project-nsd {
+ prefix "project-nsd";
+ }
+
+ import project-vnfd {
+ prefix "project-vnfd";
}
import vnfr {
container nsd {
description "NS descriptor used to instantiate this NS";
- uses nsd:nsd-descriptor-common;
+ uses nsd-base:nsd-descriptor-common;
- uses nsd:nsr-nsd-vld;
+ uses project-nsd:nsr-nsd-vld;
- uses nsd:nsr-nsd-constituent-vnfd;
+ uses project-nsd:nsr-nsd-constituent-vnfd;
- uses nsd:nsr-nsd-placement-groups;
+ uses project-nsd:nsr-nsd-placement-groups;
- uses nsd:nsr-nsd-vnf-dependency;
+ uses project-nsd:nsr-nsd-vnf-dependency;
- uses nsd:nsr-nsd-monitoring-param;
+ uses project-nsd:nsr-nsd-monitoring-param;
}
uses ns-instance-config-params;
description
"A reference to a vnfd. This is a
leafref to path:
- ../../../../nsd:constituent-vnfd
+ ../../../../project-nsd:constituent-vnfd
+ [id = current()/../id-ref]
- + /nsd:vnfd-id-ref
+ + /project-nsd:vnfd-id-ref
NOTE: An issue with confd is preventing the
use of xpath. Seems to be an issue with leafref
to leafref, whose target is in a different module.
description
"A reference to VNFD placement group";
type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = " +
- "current()/../vnfd-id-ref]/vnfd:placement-groups/vnfd:name";
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = " +
+ "current()/../vnfd-id-ref]/project-vnfd:placement-groups/project-vnfd:name";
}
}
that produced this result";
// TODO: Fix leafref
type leafref {
- path "../../../../nsd:nsd-catalog/nsd:nsd" +
- "[nsd:id = current()/../../nsd-ref]" +
- "/nsd:monitoring-param/nsd:id";
+ path "../../../../project-nsd:nsd-catalog/project-nsd:nsd" +
+ "[project-nsd:id = current()/../../nsd-ref]" +
+ "/project-nsd:monitoring-param/project-nsd:id";
}
}
description
"A reference to a vnfd. This is a
leafref to path:
- ../../../../nsd:constituent-vnfd
- + [nsd:id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
+ ../../../../project-nsd:constituent-vnfd
+ + [project-nsd:id = current()/../project-nsd:id-ref]
+ + /project-nsd:vnfd-id-ref
NOTE: An issue with confd is preventing the
use of xpath. Seems to be an issue with leafref
to leafref, whose target is in a different module.
description
"A reference to a vnfd. This is a
leafref to path:
- ../../../../nsd:constituent-vnfd
- + [id = current()/../nsd:id-ref]
- + /nsd:vnfd-id-ref
+ ../../../../project-nsd:constituent-vnfd
+ + [id = current()/../project-nsd:id-ref]
+ + /project-nsd:vnfd-id-ref
NOTE: An issue with confd is preventing the
use of xpath. Seems to be an issue with leafref
to leafref, whose target is in a different module.
"A reference to VNFD placement group";
type leafref {
path "/rw-project:project[rw-project:name=current()/" +
- "../../project-name]/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = " +
- "current()/../vnfd-id-ref]/vnfd:placement-groups/vnfd:name";
+ "../../project-name]/project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = " +
+ "current()/../vnfd-id-ref]/project-vnfd:placement-groups/project-vnfd:name";
}
}
--- /dev/null
+
+/*
+ *
+ * Copyright 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.
+ *
+ *
+ */
+
+module project-nsd
+{
+ namespace "http://riftio.com/ns/riftware-1.0/project-nsd";
+ prefix "project-nsd";
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ import project-vnfd {
+ prefix "project-vnfd";
+ }
+
+ import nsd-base {
+ prefix "nsd-base";
+ }
+
+ import rw-project {
+ prefix "rw-project";
+ }
+
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ the Network Service Descriptor (NSD)
+ under projects";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+
+ grouping nsd-constituent-vnfd {
+ list constituent-vnfd {
+ description
+ "List of VNFDs that are part of this
+ network service.";
+
+ key "member-vnf-index";
+
+ leaf member-vnf-index {
+ description
+ "Identifier/index for the VNFD. This separate id
+ is required to ensure that multiple VNFs can be
+ part of single NS";
+ type uint64;
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "Identifier for the VNFD.";
+ type leafref {
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+
+ leaf start-by-default {
+ description
+ "VNFD is started as part of the NS instantiation";
+ type boolean;
+ default true;
+ }
+ }
+ }
+
+ grouping nsr-nsd-constituent-vnfd {
+ list constituent-vnfd {
+ description
+ "List of VNFDs that are part of this
+ network service.";
+
+ key "member-vnf-index";
+
+ leaf member-vnf-index {
+ description
+ "Identifier/index for the VNFD. This separate id
+ is required to ensure that multiple VNFs can be
+ part of single NS";
+ type uint64;
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "Identifier for the VNFD.";
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+
+ leaf start-by-default {
+ description
+ "VNFD is started as part of the NS instantiation";
+ type boolean;
+ default true;
+ }
+ }
+ }
+
+ grouping nsd-vld {
+ list vld {
+
+ key "id";
+
+ uses nsd-base:nsd-vld-common;
+
+ list vnfd-connection-point-ref {
+ description
+ "A list of references to connection points.";
+ key "member-vnf-index-ref vnfd-connection-point-ref";
+
+ leaf member-vnf-index-ref {
+ description "Reference to member-vnf within constituent-vnfds";
+ // TODO (Philip): RIFT-15639
+ // type leafref {
+ // path "../../../constituent-vnfd/member-vnf-index";
+ // }
+ type uint64;
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../constituent-vnfd
+ + [id = current()/../id-ref]
+ + /vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type string;
+ }
+
+ leaf vnfd-connection-point-ref {
+ description "A reference to a connection point name";
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd" +
+ "[project-vnfd:id = current()/../vnfd-id-ref]/" +
+ "project-vnfd:connection-point/project-vnfd:name";
+ }
+ }
+ }
+ }
+ }
+
+ grouping nsr-nsd-vld {
+ list vld {
+
+ key "id";
+
+ uses nsd-base:nsd-vld-common;
+
+ list vnfd-connection-point-ref {
+ description
+ "A list of references to connection points.";
+ key "member-vnf-index-ref vnfd-connection-point-ref";
+
+ leaf member-vnf-index-ref {
+ description "Reference to member-vnf within constituent-vnfds";
+
+ type leafref {
+ path "../../../constituent-vnfd/member-vnf-index";
+ }
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type string;
+ }
+
+ leaf vnfd-connection-point-ref {
+ description "A reference to a connection point name";
+ type leafref {
+ path "../../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd" +
+ "[project-vnfd:id = current()/../vnfd-id-ref]/" +
+ "project-vnfd:connection-point/project-vnfd:name";
+ }
+ }
+ }
+ }
+ }
+
+ grouping nsd-vnf-dependency {
+ list vnf-dependency {
+ description
+ "List of VNF dependencies.";
+ key vnf-source-ref;
+ leaf vnf-source-ref {
+ type leafref {
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ leaf vnf-depends-on-ref {
+ description
+ "Reference to VNF that sorce VNF depends.";
+ type leafref {
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ }
+ }
+
+ grouping nsr-nsd-vnf-dependency {
+ list vnf-dependency {
+ description
+ "List of VNF dependencies.";
+ key vnf-source-ref;
+ leaf vnf-source-ref {
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ leaf vnf-depends-on-ref {
+ description
+ "Reference to VNF that sorce VNF depends.";
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ }
+ }
+
+ grouping nsd-placement-groups {
+ list placement-groups {
+ description "List of placement groups at NS level";
+
+ key "name";
+ uses manotypes:placement-group-info;
+
+ list member-vnfd {
+ description
+ "List of VNFDs that are part of this placement group";
+
+ key "member-vnf-index-ref";
+
+ leaf member-vnf-index-ref {
+ description "member VNF index of this member VNF";
+ // TODO (Philip): RIFT-15639
+ // type leafref {
+ // path "../../../constituent-vnfd/member-vnf-index";
+ // }
+ type uint64;
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "Identifier for the VNFD.";
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ }
+ }
+ }
+
+ grouping nsr-nsd-placement-groups {
+ list placement-groups {
+ description "List of placement groups at NS level";
+
+ key "name";
+ uses manotypes:placement-group-info;
+
+ list member-vnfd {
+ description
+ "List of VNFDs that are part of this placement group";
+
+ key "member-vnf-index-ref";
+
+ leaf member-vnf-index-ref {
+ description "member VNF index of this member VNF";
+ // TODO (Philip): RIFT-15639
+ // type leafref {
+ // path "../../../constituent-vnfd/member-vnf-index";
+ // }
+ type uint64;
+ }
+
+ leaf vnfd-id-ref {
+ description
+ "Identifier for the VNFD.";
+ type leafref {
+ path "../../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
+ }
+ }
+ }
+ }
+ }
+
+ grouping nsd-monitoring-param {
+
+ list monitoring-param {
+ key "id";
+
+ uses nsd-base:monitoring-param-common;
+
+ list vnfd-monitoring-param {
+ description "A list of VNFD monitoring params";
+ key "vnfd-id-ref vnfd-monitoring-param-ref";
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resolved this will switched to use
+ leafref";
+
+ type yang:uuid;
+ }
+
+ leaf vnfd-monitoring-param-ref {
+ description "A reference to the VNFD monitoring param";
+ type leafref {
+ path "../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd"
+ + "[project-vnfd:id = current()/../vnfd-id-ref]"
+ + "/project-vnfd:monitoring-param/project-vnfd:id";
+ }
+ }
+
+ leaf-list member-vnf-index-ref {
+ description
+ "Optional reference to member-vnf within constituent-vnfds";
+ type uint64;
+ }
+ }
+ }
+ }
+
+ grouping nsr-nsd-monitoring-param {
+ list monitoring-param {
+ key "id";
+
+ uses nsd-base:monitoring-param-common;
+
+ list vnfd-monitoring-param {
+ description "A list of VNFD monitoring params";
+ key "vnfd-id-ref vnfd-monitoring-param-ref";
+
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resolved this will switched to use
+ leafref";
+
+ type yang:uuid;
+ }
+
+ leaf vnfd-monitoring-param-ref {
+ description "A reference to the VNFD monitoring param";
+ type leafref {
+ path "../../../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd"
+ + "[project-vnfd:id = current()/../vnfd-id-ref]"
+ + "/project-vnfd:monitoring-param/project-vnfd:id";
+ }
+ }
+
+ leaf-list member-vnf-index-ref {
+ description
+ "Optional reference to member-vnf within constituent-vnfds";
+ type uint64;
+ }
+ }
+ }
+ }
+
+ grouping nsd-descriptor {
+ uses nsd-base:nsd-descriptor-common;
+
+ uses nsd-vld;
+
+ uses nsd-constituent-vnfd;
+
+ uses nsd-placement-groups;
+
+ uses nsd-vnf-dependency;
+
+ uses nsd-monitoring-param;
+ }
+
+ augment "/rw-project:project" {
+ container nsd-catalog {
+
+ list nsd {
+ key id;
+
+ uses nsd-descriptor;
+ }
+ }
+ }
+}
--- /dev/null
+
+/*
+ *
+ * Copyright 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.
+ *
+ *
+ */
+
+module project-vnfd
+{
+ namespace "http://riftio.com/ns/riftware-1.0/project-vnfd";
+ prefix "project-vnfd";
+
+ import rw-project {
+ prefix "rw-project";
+ }
+
+ import vnfd-base {
+ prefix "vnfd-base";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ the Virtual Network Function (VNF) descriptor
+ under a project";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ augment /rw-project:project {
+ container vnfd-catalog {
+ description
+ "Virtual Network Function Descriptor (VNFD).";
+
+ list vnfd {
+ key "id";
+
+ uses vnfd-base:vnfd-descriptor;
+ }
+ }
+ }
+}
+
+// vim: sw=2
--- /dev/null
+
+/*
+ *
+ * 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.
+ *
+ *
+ */
+
+module rw-nsd-base
+{
+ namespace "http://riftio.com/ns/riftware-1.0/rw-nsd-base";
+ prefix "rw-nsd-base";
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ grouping to extend the base MANO NSD";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ grouping rw-nsd-ext {
+ uses manotypes:control-param;
+ uses manotypes:action-param;
+ leaf meta {
+ description
+ "Any meta-data needed by the UI";
+ type string;
+ }
+ }
+}
+
+// vim: sw=2
namespace "http://riftio.com/ns/riftware-1.0/rw-nsd";
prefix "rw-nsd";
- import nsd {
- prefix "nsd";
- }
-
- import ietf-yang-types {
- prefix "yang";
+ import rw-nsd-base {
+ prefix "rw-nsd-base";
}
- import mano-types {
- prefix "manotypes";
- }
-
- import rw-project {
- prefix "rw-project";
+ import nsd {
+ prefix "nsd";
}
- revision 2017-02-08 {
+ revision 2017-02-28 {
description
"Update model to support projects.";
}
"Derived from earlier versions of base YANG files";
}
- augment /rw-project:project/nsd:nsd-catalog/nsd:nsd {
- uses manotypes:control-param;
- uses manotypes:action-param;
- leaf meta {
- description
- "Any meta-data needed by the UI";
- type string;
- }
+ augment /nsd:nsd-catalog/nsd:nsd {
+ uses rw-nsd-base:rw-nsd-ext;
}
}
prefix "nsr";
}
- import nsd {
- prefix "nsd";
+ import project-nsd {
+ prefix "project-nsd";
}
import rw-cloud {
leaf nsd-id-ref {
description "Reference to NSD";
type leafref {
- path "../../../nsd:nsd-catalog/nsd:nsd/nsd:id";
+ path "../../../project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:id";
}
}
leaf instance-ref-count {
--- /dev/null
+
+/*
+ *
+ * Copyright 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.
+ *
+ *
+ */
+
+module rw-project-nsd
+{
+ namespace "http://riftio.com/ns/riftware-1.0/rw-project-nsd";
+ prefix "rw-project-nsd";
+
+ import rw-nsd-base {
+ prefix "rw-nsd-base";
+ }
+
+ import project-nsd {
+ prefix "nsd";
+ }
+
+ import rw-project {
+ prefix "rw-project";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file augments
+ the base MANO NSD";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ augment /rw-project:project/nsd:nsd-catalog/nsd:nsd {
+ uses rw-nsd-base:rw-nsd-ext;
+ }
+}
+
+// vim: sw=2
--- /dev/null
+
+/*
+ *
+ * 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.
+ *
+ *
+ */
+
+module rw-project-vnfd
+{
+ namespace "http://riftio.com/ns/riftware-1.0/rw-project-vnfd";
+ prefix "rw-project-vnfd";
+
+ import project-vnfd {
+ prefix "project-vnfd";
+ }
+
+ import rw-vnfd-base {
+ prefix "rw-vnfd-base";
+ }
+
+ import rw-project {
+ prefix "rw-project";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file augments
+ the base MANO VNFD";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ augment /rw-project:project/project-vnfd:vnfd-catalog/project-vnfd:vnfd {
+ uses rw-vnfd-base:rw-vnfd-ext;
+ }
+
+ augment /rw-project:project/project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:vdu {
+ uses rw-vnfd-base:vcs-component-ref;
+ }
+}
+// vim: sw=2
--- /dev/null
+
+/*
+ *
+ * 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.
+ *
+ *
+ */
+
+module rw-vnfd-base
+{
+ namespace "http://riftio.com/ns/riftware-1.0/rw-vnfd-base";
+ prefix "rw-vnfd-base";
+
+ import vnfd {
+ prefix "vnfd";
+ }
+
+ import rwvcs-types {
+ prefix "rwvcstypes";
+ }
+
+ import rw-pb-ext { prefix "rwpb"; }
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ common structs for extending MANO VNFD";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ grouping rw-vnfd-ext {
+ uses manotypes:control-param;
+ uses manotypes:action-param;
+
+ leaf meta {
+ description
+ "Any meta-data needed by the UI";
+ type string;
+ }
+
+ list component {
+ description
+ "This section defines the RIFT.ware
+ virtual components";
+ key "component-name";
+ rwpb:msg-new VcsComponent;
+ rwpb:application-request-point;
+
+ leaf component-name {
+ description "";
+ type string;
+ }
+
+ leaf component-type {
+ description "";
+ type rwvcstypes:component_type;
+ mandatory true;
+ }
+
+ choice component {
+ case rwvcs-rwcollection {
+ uses rwvcstypes:rwvcs-rwcollection;
+ }
+ case rwvcs-rwvm {
+ uses rwvcstypes:rwvcs-rwvm;
+ }
+ case rwvcs-rwproc {
+ uses rwvcstypes:rwvcs-rwproc;
+ }
+ case native-proc {
+ uses rwvcstypes:native-proc;
+ }
+ case rwvcs-rwtasklet {
+ uses rwvcstypes:rwvcs-rwtasklet;
+ }
+ }
+ } // list component
+ }
+
+ grouping vcs-component-ref {
+ leaf vcs-component-ref {
+ description
+ "This defines the software components using the
+ RIFT.ware Virtual Component System (VCS). This
+ also allows specifying a state machine during
+ the VM startup.
+ NOTE: This is an significant addition to MANO,
+ since MANO doesn't clearly specify a method to
+ identify various software components in a VM.
+ Also using a state machine is not something that
+ is well described in MANO.";
+ type leafref {
+ path "../../component/component-name";
+ }
+ }
+ }
+}
+// vim: sw=2
prefix "vnfd";
}
- import rwvcs-types {
- prefix "rwvcstypes";
+ import rw-vnfd-base {
+ prefix "rw-vnfd-base";
}
- import rw-pb-ext { prefix "rwpb"; }
-
- import ietf-yang-types {
- prefix "yang";
- }
-
- import mano-types {
- prefix "manotypes";
- }
-
- import rw-project {
- prefix "rw-project";
- }
-
- revision 2017-02-08 {
+ revision 2017-02-28 {
description
"Update model to support projects.";
}
"Derived from earlier versions of base YANG files";
}
- augment /rw-project:project/vnfd:vnfd-catalog/vnfd:vnfd {
- uses manotypes:control-param;
- uses manotypes:action-param;
- leaf meta {
- description
- "Any meta-data needed by the UI";
- type string;
- }
- list component {
- description
- "This section defines the RIFT.ware
- virtual components";
- key "component-name";
- rwpb:msg-new VcsComponent;
- rwpb:application-request-point;
-
- leaf component-name {
- description "";
- type string;
- }
-
- leaf component-type {
- description "";
- type rwvcstypes:component_type;
- mandatory true;
- }
-
- choice component {
- case rwvcs-rwcollection {
- uses rwvcstypes:rwvcs-rwcollection;
- }
- case rwvcs-rwvm {
- uses rwvcstypes:rwvcs-rwvm;
- }
- case rwvcs-rwproc {
- uses rwvcstypes:rwvcs-rwproc;
- }
- case native-proc {
- uses rwvcstypes:native-proc;
- }
- case rwvcs-rwtasklet {
- uses rwvcstypes:rwvcs-rwtasklet;
- }
- }
- } // list component
+ augment /vnfd:vnfd-catalog/vnfd:vnfd {
+ uses rw-vnfd-base:rw-vnfd-ext;
}
- augment /rw-project:project/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu {
- leaf vcs-component-ref {
- description
- "This defines the software components using the
- RIFT.ware Virtual Component System (VCS). This
- also allows specifying a state machine during
- the VM startup.
- NOTE: This is an significant addition to MANO,
- since MANO doesn't clearly specify a method to
- identify various software components in a VM.
- Also using a state machine is not something that
- is well described in MANO.";
- type leafref {
- path "../../rw-vnfd:component/rw-vnfd:component-name";
- }
- }
+ augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu {
+ uses rw-vnfd-base:vcs-component-ref;
}
}
// vim: sw=2
prefix "manotypes";
}
- import rw-pb-ext { prefix "rwpb"; }
+ import rw-pb-ext {
+ prefix "rwpb";
+ }
import vnfr {
prefix "vnfr";
}
- import vnfd {
- prefix "vnfd";
+ import project-vnfd {
+ prefix "project-vnfd";
}
import rw-cloud {
prefix "rw-project";
}
- revision 2017-02-08 {
+ revision 2017-02-28 {
description
"Update model to support projects.";
}
leaf vnfd-id-ref {
description "Reference to VNFD";
type leafref {
- path "../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
}
}
leaf instance-ref-count {
prefix "rwpb";
}
- import vnfd {
- prefix "vnfd";
+ import project-vnfd {
+ prefix "project-vnfd";
}
import ietf-inet-types {
leaf vnfd-ref {
description "A reference to a vnfd";
type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
}
}
description
"A reference to the consituent-vnfd id in nsd.
Should have been a leafref to:
- '/nsd:nsd-catalog:/nsd:nsd/constituent-vnfd/member-vnf-index-ref'.
+ '/rw-project:project/project-nsd:nsd-catalog:/nsd/constituent-vnfd/member-vnf-index-ref'.
Instead using direct leaf to avoid circular reference.";
type uint64;
}
description
"A reference to a connection point name in a vnfd";
type leafref {
- path "../../../../vnfd:vnfd-catalog/vnfd:vnfd"
- + "[vnfd:id = current()/../vld:vnfd-ref]"
- + "/vnfd:connection-point/vnfd:name";
+ path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd"
+ + "[project-vnfd:id = current()/../vld:vnfd-ref]"
+ + "/project-vnfd:connection-point/project-vnfd:name";
}
}
}
--- /dev/null
+
+/*
+ *
+ * Copyright 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.
+ *
+ *
+ */
+
+module vnfd-base
+{
+ namespace "http://riftio.com/ns/riftware-1.0/vnfd-base";
+ prefix "vnfd-base";
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ import rw-pb-ext {
+ prefix "rwpb";
+ }
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ the common types for Virtual Network Function
+ (VNF) descriptor";
+ reference
+ "Derived from earlier versions of base YANG files";
+ }
+
+ grouping common-connection-point {
+ leaf name {
+ description "Name of the connection point";
+ type string;
+ }
+
+ leaf id {
+ description "Identifier for the internal connection points";
+ type string;
+ }
+
+ leaf short-name {
+ description "Short name of the connection point";
+ type string;
+ }
+
+ leaf type {
+ description "Type of the connection point.";
+ type manotypes:connection-point-type;
+ }
+ leaf port-security-enabled {
+ description "Enables the port security for the port";
+ type boolean;
+ }
+ }
+
+ grouping virtual-interface {
+ container virtual-interface {
+ description
+ "Container for the virtual interface properties";
+
+ leaf type {
+ description
+ "Specifies the type of virtual interface
+ between VM and host.
+ VIRTIO : Use the traditional VIRTIO interface.
+ PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
+ SR-IOV : Use SR-IOV interface.
+ E1000 : Emulate E1000 interface.
+ RTL8139 : Emulate RTL8139 interface.
+ PCNET : Emulate PCNET interface.
+ OM-MGMT : Used to specify openmano mgmt external-connection type";
+
+ type enumeration {
+ enum OM-MGMT;
+ enum PCI-PASSTHROUGH;
+ enum SR-IOV;
+ enum VIRTIO;
+ enum E1000;
+ enum RTL8139;
+ enum PCNET;
+ }
+ default "VIRTIO";
+ }
+
+ leaf vpci {
+ description
+ "Specifies the virtual PCI address. Expressed in
+ the following format dddd:dd:dd.d. For example
+ 0000:00:12.0. This information can be used to
+ pass as metadata during the VM creation.";
+ type string;
+ }
+
+ leaf bandwidth {
+ description
+ "Aggregate bandwidth of the NIC.";
+ type uint64;
+ }
+ }
+ }
+
+ grouping vnfd-descriptor {
+ leaf id {
+ description "Identifier for the VNFD.";
+ type string;
+ }
+
+ leaf name {
+ description "VNFD name.";
+ mandatory true;
+ type string;
+ }
+
+ leaf short-name {
+ description "VNFD short name.";
+ type string;
+ }
+
+ leaf vendor {
+ description "Vendor of the VNFD.";
+ type string;
+ }
+
+ leaf logo {
+ description
+ "Vendor logo for the Virtual Network Function";
+ type string;
+ }
+
+ leaf description {
+ description "Description of the VNFD.";
+ type string;
+ }
+
+ leaf version {
+ description "Version of the VNFD";
+ type string;
+ }
+
+ uses manotypes:vnf-configuration;
+
+ container mgmt-interface {
+ description
+ "Interface over which the VNF is managed.";
+
+ choice endpoint-type {
+ description
+ "Indicates the type of management endpoint.";
+
+ case ip {
+ description
+ "Specifies the static IP address for managing the VNF.";
+ leaf ip-address {
+ type inet:ip-address;
+ }
+ }
+
+ case vdu-id {
+ description
+ "Use the default management interface on this VDU.";
+ leaf vdu-id {
+ type leafref {
+ path "../../vdu/id";
+ }
+ }
+ }
+
+ case cp {
+ description
+ "Use the ip address associated with this connection point.";
+ leaf cp {
+ type leafref {
+ path "../../connection-point/name";
+ }
+ }
+ }
+ }
+
+ leaf port {
+ description
+ "Port for the management interface.";
+ type inet:port-number;
+ }
+
+ container dashboard-params {
+ description "Parameters for the VNF dashboard";
+
+ leaf path {
+ description "The HTTP path for the dashboard";
+ type string;
+ }
+
+ leaf https {
+ description "Pick HTTPS instead of HTTP , Default is false";
+ type boolean;
+ }
+
+ leaf port {
+ description "The HTTP port for the dashboard";
+ type inet:port-number;
+ }
+ }
+ }
+
+ list internal-vld {
+ key "id";
+ description
+ "List of Internal Virtual Link Descriptors (VLD).
+ The internal VLD describes the basic topology of
+ the connectivity (e.g. E-LAN, E-Line, E-Tree)
+ between internal VNF components of the system.";
+
+ leaf id {
+ description "Identifier for the VLD";
+ type string;
+ }
+
+ leaf name {
+ description "Name of the internal VLD";
+ type string;
+ }
+
+ leaf short-name {
+ description "Short name of the internal VLD";
+ type string;
+ }
+
+ leaf description {
+ type string;
+ }
+
+ leaf type {
+ type manotypes:virtual-link-type;
+ }
+
+ leaf root-bandwidth {
+ description
+ "For ELAN this is the aggregate bandwidth.";
+ type uint64;
+ }
+
+ leaf leaf-bandwidth {
+ description
+ "For ELAN this is the bandwidth of branches.";
+ type uint64;
+ }
+
+ list internal-connection-point {
+ key "id-ref";
+ description "List of internal connection points in this VLD";
+ leaf id-ref {
+ description "reference to the internal connection point id";
+ type leafref {
+ path "../../../vdu/internal-connection-point/id";
+ }
+ }
+ }
+ uses manotypes:provider-network;
+ choice init-params {
+ description "Extra parameters for VLD instantiation";
+
+ case vim-network-ref {
+ leaf vim-network-name {
+ description
+ "Name of network in VIM account. This is used to indicate
+ pre-provisioned network name in cloud account.";
+ type string;
+ }
+ }
+
+ case vim-network-profile {
+ leaf ip-profile-ref {
+ description "Named reference to IP-profile object";
+ type string;
+ }
+ }
+
+ }
+ }
+
+ uses manotypes:ip-profile-list;
+
+ list connection-point {
+ key "name";
+ description
+ "List for external connection points. Each VNF has one
+ or more external connection points. As the name
+ implies that external connection points are used for
+ connecting the VNF to other VNFs or to external networks.
+ Each VNF exposes these connection points to the
+ orchestrator. The orchestrator can construct network
+ services by connecting the connection points between
+ different VNFs. The NFVO will use VLDs and VNFFGs at
+ the network service level to construct network services.";
+
+ uses common-connection-point;
+ }
+
+ list vdu {
+ description "List of Virtual Deployment Units";
+ key "id";
+
+ leaf id {
+ description "Unique id for the VDU";
+ type string;
+ }
+
+ leaf name {
+ description "Unique name for the VDU";
+ type string;
+ }
+
+ leaf description {
+ description "Description of the VDU.";
+ type string;
+ }
+
+ leaf count {
+ description "Number of instances of VDU";
+ type uint64;
+ }
+
+ leaf mgmt-vpci {
+ description
+ "Specifies the virtual PCI address. Expressed in
+ the following format dddd:dd:dd.d. For example
+ 0000:00:12.0. This information can be used to
+ pass as metadata during the VM creation.";
+ type string;
+ }
+
+ uses manotypes:vm-flavor;
+ uses manotypes:guest-epa;
+ uses manotypes:vswitch-epa;
+ uses manotypes:hypervisor-epa;
+ uses manotypes:host-epa;
+
+ list alarm {
+ key "alarm-id";
+
+ uses manotypes:alarm;
+ }
+
+ uses manotypes:image-properties;
+
+ choice cloud-init-input {
+ description
+ "Indicates how the contents of cloud-init script are provided.
+ There are 2 choices - inline or in a file";
+
+ case inline {
+ leaf cloud-init {
+ description
+ "Contents of cloud-init script, provided inline, in cloud-config format";
+ type string;
+ }
+ }
+
+ case filename {
+ leaf cloud-init-file {
+ description
+ "Name of file with contents of cloud-init script in cloud-config format";
+ type string;
+ }
+ }
+ }
+
+ uses manotypes:supplemental-boot-data;
+
+ list internal-connection-point {
+ key "id";
+ description
+ "List for internal connection points. Each VNFC
+ has zero or more internal connection points.
+ Internal connection points are used for connecting
+ the VNF components internal to the VNF. If a VNF
+ has only one VNFC, it may not have any internal
+ connection points.";
+
+ uses common-connection-point;
+
+ leaf internal-vld-ref {
+ type leafref {
+ path "../../../internal-vld/id";
+ }
+ }
+ }
+
+ list internal-interface {
+ description
+ "List of internal interfaces for the VNF";
+ key name;
+
+ leaf name {
+ description
+ "Name of internal interface. Note that this
+ name has only local significance to the VDU.";
+ type string;
+ }
+
+ leaf vdu-internal-connection-point-ref {
+ type leafref {
+ path "../../internal-connection-point/id";
+ }
+ }
+ uses virtual-interface;
+ }
+
+ list external-interface {
+ description
+ "List of external interfaces for the VNF.
+ The external interfaces enable sending
+ traffic to and from VNF.";
+ key name;
+
+ leaf name {
+ description
+ "Name of the external interface. Note that
+ this name has only local significance.";
+ type string;
+ }
+
+ leaf vnfd-connection-point-ref {
+ description
+ "Name of the external connection point.";
+ type leafref {
+ path "../../../connection-point/name";
+ }
+ }
+ uses virtual-interface;
+ }
+
+ list volumes {
+ key "name";
+
+ leaf name {
+ description "Name of the disk-volumes, e.g. vda, vdb etc";
+ type string;
+ }
+
+ uses manotypes:volume-info;
+ }
+ }
+
+ list vdu-dependency {
+ description
+ "List of VDU dependencies.";
+
+ key vdu-source-ref;
+ leaf vdu-source-ref {
+ type leafref {
+ path "../../vdu/id";
+ }
+ }
+
+ leaf vdu-depends-on-ref {
+ description
+ "Reference to the VDU that
+ source VDU depends.";
+ type leafref {
+ path "../../vdu/id";
+ }
+ }
+ }
+
+ leaf service-function-chain {
+ description "Type of node in Service Function Chaining Architecture";
+
+ type enumeration {
+ enum UNAWARE;
+ enum CLASSIFIER;
+ enum SF;
+ enum SFF;
+ }
+ default "UNAWARE";
+ }
+
+ leaf service-function-type {
+ description
+ "Type of Service Function.
+ NOTE: This needs to map with Service Function Type in ODL to
+ support VNFFG. Service Function Type is manadatory param in ODL
+ SFC. This is temporarily set to string for ease of use";
+ type string;
+ }
+
+ uses manotypes:monitoring-param;
+
+ list placement-groups {
+ description "List of placement groups at VNF level";
+
+ key "name";
+ uses manotypes:placement-group-info;
+
+ list member-vdus {
+
+ description
+ "List of VDUs that are part of this placement group";
+ key "member-vdu-ref";
+
+ leaf member-vdu-ref {
+ type leafref {
+ path "../../../vdu/id";
+ }
+ }
+ }
+ }
+ }
+}
+
+// vim: sw=2
namespace "urn:ietf:params:xml:ns:yang:nfvo:vnfd";
prefix "vnfd";
- import mano-types {
- prefix "manotypes";
+ import vnfd-base {
+ prefix "vnfd-base";
}
- import rw-pb-ext {
- prefix "rwpb";
- }
-
- import ietf-yang-types {
- prefix "yang";
- }
-
- import ietf-inet-types {
- prefix "inet";
- }
-
- import rw-project {
- prefix "rw-project";
- }
-
- revision 2017-02-08 {
+ revision 2017-02-28 {
description
"Update model to support projects.";
}
"Derived from earlier versions of base YANG files";
}
- grouping common-connection-point {
- leaf name {
- description "Name of the connection point";
- type string;
- }
-
- leaf id {
- description "Identifier for the internal connection points";
- type string;
- }
-
- leaf short-name {
- description "Short name of the connection point";
- type string;
- }
-
- leaf type {
- description "Type of the connection point.";
- type manotypes:connection-point-type;
- }
- leaf port-security-enabled {
- description "Enables the port security for the port";
- type boolean;
- }
- }
-
- grouping virtual-interface {
- container virtual-interface {
- description
- "Container for the virtual interface properties";
-
- leaf type {
- description
- "Specifies the type of virtual interface
- between VM and host.
- VIRTIO : Use the traditional VIRTIO interface.
- PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
- SR-IOV : Use SR-IOV interface.
- E1000 : Emulate E1000 interface.
- RTL8139 : Emulate RTL8139 interface.
- PCNET : Emulate PCNET interface.
- OM-MGMT : Used to specify openmano mgmt external-connection type";
-
- type enumeration {
- enum OM-MGMT;
- enum PCI-PASSTHROUGH;
- enum SR-IOV;
- enum VIRTIO;
- enum E1000;
- enum RTL8139;
- enum PCNET;
- }
- default "VIRTIO";
- }
-
- leaf vpci {
- description
- "Specifies the virtual PCI address. Expressed in
- the following format dddd:dd:dd.d. For example
- 0000:00:12.0. This information can be used to
- pass as metadata during the VM creation.";
- type string;
- }
-
- leaf bandwidth {
- description
- "Aggregate bandwidth of the NIC.";
- type uint64;
- }
- }
- }
-
- grouping vnfd-descriptor {
- leaf id {
- description "Identifier for the VNFD.";
- type string;
- }
-
- leaf name {
- description "VNFD name.";
- mandatory true;
- type string;
- }
-
- leaf short-name {
- description "VNFD short name.";
- type string;
- }
-
- leaf vendor {
- description "Vendor of the VNFD.";
- type string;
- }
-
- leaf logo {
- description
- "Vendor logo for the Virtual Network Function";
- type string;
- }
-
- leaf description {
- description "Description of the VNFD.";
- type string;
- }
-
- leaf version {
- description "Version of the VNFD";
- type string;
- }
-
- uses manotypes:vnf-configuration;
-
- container mgmt-interface {
- description
- "Interface over which the VNF is managed.";
-
- choice endpoint-type {
- description
- "Indicates the type of management endpoint.";
-
- case ip {
- description
- "Specifies the static IP address for managing the VNF.";
- leaf ip-address {
- type inet:ip-address;
- }
- }
-
- case vdu-id {
- description
- "Use the default management interface on this VDU.";
- leaf vdu-id {
- type leafref {
- path "../../vdu/id";
- }
- }
- }
-
- case cp {
- description
- "Use the ip address associated with this connection point.";
- leaf cp {
- type leafref {
- path "../../connection-point/name";
- }
- }
- }
- }
-
- leaf port {
- description
- "Port for the management interface.";
- type inet:port-number;
- }
-
- container dashboard-params {
- description "Parameters for the VNF dashboard";
-
- leaf path {
- description "The HTTP path for the dashboard";
- type string;
- }
-
- leaf https {
- description "Pick HTTPS instead of HTTP , Default is false";
- type boolean;
- }
-
- leaf port {
- description "The HTTP port for the dashboard";
- type inet:port-number;
- }
- }
- }
-
- list internal-vld {
- key "id";
- description
- "List of Internal Virtual Link Descriptors (VLD).
- The internal VLD describes the basic topology of
- the connectivity (e.g. E-LAN, E-Line, E-Tree)
- between internal VNF components of the system.";
-
- leaf id {
- description "Identifier for the VLD";
- type string;
- }
-
- leaf name {
- description "Name of the internal VLD";
- type string;
- }
-
- leaf short-name {
- description "Short name of the internal VLD";
- type string;
- }
-
- leaf description {
- type string;
- }
-
- leaf type {
- type manotypes:virtual-link-type;
- }
-
- leaf root-bandwidth {
- description
- "For ELAN this is the aggregate bandwidth.";
- type uint64;
- }
-
- leaf leaf-bandwidth {
- description
- "For ELAN this is the bandwidth of branches.";
- type uint64;
- }
-
- list internal-connection-point {
- key "id-ref";
- description "List of internal connection points in this VLD";
- leaf id-ref {
- description "reference to the internal connection point id";
- type leafref {
- path "../../../vdu/internal-connection-point/id";
- }
- }
- }
- uses manotypes:provider-network;
- choice init-params {
- description "Extra parameters for VLD instantiation";
-
- case vim-network-ref {
- leaf vim-network-name {
- description
- "Name of network in VIM account. This is used to indicate
- pre-provisioned network name in cloud account.";
- type string;
- }
- }
-
- case vim-network-profile {
- leaf ip-profile-ref {
- description "Named reference to IP-profile object";
- type string;
- }
- }
-
- }
- }
-
- uses manotypes:ip-profile-list;
-
- list connection-point {
- key "name";
- description
- "List for external connection points. Each VNF has one
- or more external connection points. As the name
- implies that external connection points are used for
- connecting the VNF to other VNFs or to external networks.
- Each VNF exposes these connection points to the
- orchestrator. The orchestrator can construct network
- services by connecting the connection points between
- different VNFs. The NFVO will use VLDs and VNFFGs at
- the network service level to construct network services.";
-
- uses common-connection-point;
- }
-
- list vdu {
- description "List of Virtual Deployment Units";
- key "id";
-
- leaf id {
- description "Unique id for the VDU";
- type string;
- }
-
- leaf name {
- description "Unique name for the VDU";
- type string;
- }
-
- leaf description {
- description "Description of the VDU.";
- type string;
- }
-
- leaf count {
- description "Number of instances of VDU";
- type uint64;
- }
-
- leaf mgmt-vpci {
- description
- "Specifies the virtual PCI address. Expressed in
- the following format dddd:dd:dd.d. For example
- 0000:00:12.0. This information can be used to
- pass as metadata during the VM creation.";
- type string;
- }
-
- uses manotypes:vm-flavor;
- uses manotypes:guest-epa;
- uses manotypes:vswitch-epa;
- uses manotypes:hypervisor-epa;
- uses manotypes:host-epa;
-
- list alarm {
- key "alarm-id";
-
- uses manotypes:alarm;
- }
-
- uses manotypes:image-properties;
-
- choice cloud-init-input {
- description
- "Indicates how the contents of cloud-init script are provided.
- There are 2 choices - inline or in a file";
-
- case inline {
- leaf cloud-init {
- description
- "Contents of cloud-init script, provided inline, in cloud-config format";
- type string;
- }
- }
-
- case filename {
- leaf cloud-init-file {
- description
- "Name of file with contents of cloud-init script in cloud-config format";
- type string;
- }
- }
- }
-
- uses manotypes:supplemental-boot-data;
-
- list internal-connection-point {
- key "id";
- description
- "List for internal connection points. Each VNFC
- has zero or more internal connection points.
- Internal connection points are used for connecting
- the VNF components internal to the VNF. If a VNF
- has only one VNFC, it may not have any internal
- connection points.";
-
- uses common-connection-point;
-
- leaf internal-vld-ref {
- type leafref {
- path "../../../internal-vld/id";
- }
- }
- }
-
- list internal-interface {
- description
- "List of internal interfaces for the VNF";
- key name;
-
- leaf name {
- description
- "Name of internal interface. Note that this
- name has only local significance to the VDU.";
- type string;
- }
-
- leaf vdu-internal-connection-point-ref {
- type leafref {
- path "../../internal-connection-point/id";
- }
- }
- uses virtual-interface;
- }
-
- list external-interface {
- description
- "List of external interfaces for the VNF.
- The external interfaces enable sending
- traffic to and from VNF.";
- key name;
-
- leaf name {
- description
- "Name of the external interface. Note that
- this name has only local significance.";
- type string;
- }
-
- leaf vnfd-connection-point-ref {
- description
- "Name of the external connection point.";
- type leafref {
- path "../../../connection-point/name";
- }
- }
- uses virtual-interface;
- }
-
- list volumes {
- key "name";
-
- leaf name {
- description "Name of the disk-volumes, e.g. vda, vdb etc";
- type string;
- }
-
- uses manotypes:volume-info;
- }
- }
-
- list vdu-dependency {
- description
- "List of VDU dependencies.";
-
- key vdu-source-ref;
- leaf vdu-source-ref {
- type leafref {
- path "../../vdu/id";
- }
- }
-
- leaf vdu-depends-on-ref {
- description
- "Reference to the VDU that
- source VDU depends.";
- type leafref {
- path "../../vdu/id";
- }
- }
- }
-
- leaf service-function-chain {
- description "Type of node in Service Function Chaining Architecture";
-
- type enumeration {
- enum UNAWARE;
- enum CLASSIFIER;
- enum SF;
- enum SFF;
- }
- default "UNAWARE";
- }
-
- leaf service-function-type {
- description
- "Type of Service Function.
- NOTE: This needs to map with Service Function Type in ODL to
- support VNFFG. Service Function Type is manadatory param in ODL
- SFC. This is temporarily set to string for ease of use";
- type string;
- }
-
- uses manotypes:monitoring-param;
-
- list placement-groups {
- description "List of placement groups at VNF level";
-
- key "name";
- uses manotypes:placement-group-info;
-
- list member-vdus {
-
- description
- "List of VDUs that are part of this placement group";
- key "member-vdu-ref";
-
- leaf member-vdu-ref {
- type leafref {
- path "../../../vdu/id";
- }
- }
- }
- }
- }
-
- augment "/rw-project:project" {
- container vnfd-catalog {
- description
- "Virtual Network Function Descriptor (VNFD).";
+ container vnfd-catalog {
+ description
+ "Virtual Network Function Descriptor (VNFD).";
- list vnfd {
- key "id";
+ list vnfd {
+ key "id";
- uses vnfd-descriptor;
- }
+ uses vnfd-base:vnfd-descriptor;
}
}
}
prefix "rwpb";
}
- import vnfd {
- prefix "vnfd";
+ import vnfd-base {
+ prefix "vnfd-base";
}
- import nsd {
- prefix "nsd";
+ import project-nsd {
+ prefix "project-nsd";
}
import vlr {
prefix "rw-cloud";
}
- revision 2017-02-08 {
+ revision 2017-02-28 {
description
"Update model to support projects.";
}
leaf member-vnf-index-ref {
description "Reference to member VNF index in Network service.";
type leafref {
- path "../../../nsd:nsd-catalog/nsd:nsd/nsd:constituent-vnfd/nsd:member-vnf-index";
+ path "../../../project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:constituent-vnfd/project-nsd:member-vnf-index";
}
}
container vnfd {
description "VNF descriptor used to instantiate this VNF";
- uses vnfd:vnfd-descriptor;
+ uses vnfd-base:vnfd-descriptor;
}
// Use parameters provided here to configure this VNF
different VNFs. The NFVO will use VLDs and VNFFGs at
the network service level to construct network services.";
- uses vnfd:common-connection-point;
+ uses vnfd-base:common-connection-point;
leaf vlr-ref {
description
has only one VNFC, it may not have any internal
connection points.";
- uses vnfd:common-connection-point;
+ uses vnfd-base:common-connection-point;
leaf ip-address {
description
if nsr_obj.cm_nsr['state'] != nsr_obj.state_to_string(conmanY.RecordState.INIT):
self._log.debug("NSR(%s) is already processed, state=%s",
nsr_obj.nsr_name, nsr_obj.cm_nsr['state'])
- yield from nsr_obj.publish_cm_state()
+ # yield from nsr_obj.publish_cm_state()
return True
cmdts_obj = self.cmdts_obj
@staticmethod
def nsd_msg(k=None):
- return ("C,/nsd:nsd-catalog/nsd:nsd" +
- "[nsd:id = '{}']".format(k) if k is not None else "")
+ return ("C,/project-nsd:nsd-catalog/project-nsd:nsd" +
+ "[project-nsd:id = '{}']".format(k) if k is not None else "")
@staticmethod
def vnfr_opdata(k=None):
@staticmethod
def vnfd(k=None):
- return ("C,/vnfd:vnfd-catalog/vnfd:vnfd" +
- ("[vnfd:id='{}']".format(k) if k is not None else ""))
+ return ("C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd" +
+ ("[project-vnfd:id='{}']".format(k) if k is not None else ""))
@staticmethod
def config_agent(k=None):
prefix "rwcli";
}
+ import rw-project-vnfd {
+ prefix "rw-project-vnfd";
+ }
+
+ import rw-project-nsd {
+ prefix "rw-project-nsd";
+ }
+
import nsr {
prefix "nsr";
}
ietf-restconf-monitoring
ietf-yang-types
mano-types
-nsd
+nsd-base
nsr
+project-nsd
+project-vnfd
rw-base
rwcal
rw-cli-ext
rw-netconf
rw-restconf
rw-notify-ext
-rw-nsd
+rw-nsd-base
rw-nsm
rw-nsr
rw-pb-ext
rw-project
+rw-project-nsd
+rw-project-vnfd
rw-resource-mgr
rw-restportforward
rwsdn
rwvcs-types
rw-vld
rw-vlr
-rw-vnfd
+rw-vnfd-base
rw-vnfr
rw-yang-types
vld
vlr
-vnfd
+project-vnfd
vnffgd
vnfr
from gi.repository import (
RwNsrYang,
NsrYang,
- NsdYang,
+ ProjectNsdYang as NsdYang,
RwLaunchpadYang as launchpadyang,
RwVnfrYang,
- RwVnfdYang,
- RwNsdYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwProjectNsdYang as RwNsdYang,
VnfrYang
)
-#
-# Copyright 2016 RIFT.IO Inc
+#
+# 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.
import json
import logging
import os
-import tempfile
-import yaml
import gi
gi.require_version('RwNsdYang', '1.0')
+gi.require_version('RwProjectNsdYang', '1.0')
gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwYang', '1.0')
from gi.repository import (
RwNsdYang,
RwVnfdYang,
NsdYang,
VnfdYang,
+ RwProjectNsdYang,
+ RwProjectVnfdYang,
+ ProjectNsdYang,
+ ProjectVnfdYang,
RwYang,
)
"""(De)Serializer/deserializer fo a specific protobuf message into various formats"""
libncx_model = None
- def __init__(self, yang_ns, yang_pb_cls):
+ def __init__(self, yang_ns, yang_pb_cls,
+ yang_ns_project, yang_pb_project_cls):
""" Create a serializer for a specific protobuf message """
self._yang_ns = yang_ns
self._yang_pb_cls = yang_pb_cls
+ self._yang_ns_project = yang_ns_project
+ self._yang_pb_project_cls = yang_pb_project_cls
+
+ self._log = logging.getLogger('rw-maon-log')
@classmethod
def _deserialize_extension_method_map(cls):
@property
def yang_class(self):
- """ The Protobuf's GI class (e.g. RwVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd) """
+ """ The Protobuf's GI class (e.g. RwVnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd) """
return self._yang_pb_cls
+ @property
+ def yang_ns_project(self):
+ """ The Protobuf's GI namespace class (e.g. RwProjectVnfdYang) """
+ return self._yang_ns_project
+
+ @property
+ def yang_class_project(self):
+ """ The Protobuf's GI class (e.g. RwProjectVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd) """
+ return self._yang_pb_project_cls
+
@property
def model(self):
cls = self.__class__
if cls.libncx_model is None:
cls.libncx_model = RwYang.model_create_libncx()
cls.libncx_model.load_schema_ypbc(self.yang_namespace.get_schema())
+ cls.libncx_model.load_schema_ypbc(self.yang_ns_project.get_schema())
return cls.libncx_model
# Need to prefix project on to the descriptor and then
# convert to yang pb
# TODO: See if there is a better way to do this
- desc = {NS_PROJECT: []}
- desc[NS_PROJECT].append(yaml.load(decode(yml)))
+ # desc = {NS_PROJECT: []}
+ # desc[NS_PROJECT].append(yaml.load(decode(yml)))
# log = logging.getLogger('rw-mano-log')
# log.error("Desc from yaml: {}".format(desc))
- return self.yang_class.from_yaml(self.model, yaml.dump(desc), strict=False)
+ # return self.yang_class.from_yaml(self.model, yaml.dump(desc), strict=False)
+
+ try:
+ desc_msg = self.yang_class.from_yaml(self.model, decode(yml), strict=False)
+ return self.yang_class_project.from_dict(desc_msg.as_dict())
+ except Exception as e:
+ self._log.exception(e)
+ raise e
- def to_json_string(self, pb_msg):
+ def to_desc_msg(self, pb_msg, project_rooted=True):
+ """Convert to and from project rooted pb msg descriptor to catalog
+ rooted pb msg
+ """
+ if project_rooted:
+ if isinstance(pb_msg, self._yang_pb_project_cls):
+ return self._yang_pb_cls.from_dict(pb_msg.as_dict())
+ elif isinstance(pb_msg, self._yang_pb_cls):
+ return pb_msg
+
+ else:
+ if isinstance(pb_msg, self._yang_pb_cls):
+ return self._yang_pb_project_cls.from_dict(pb_msg.as_dict())
+ elif isinstance(pb_msg, self._yang_pb_project_cls):
+ return pb_msg
+
+ raise TypeError("Invalid protobuf message type provided: {}".format(type(pb_msg)))
+
+
+ def to_json_string(self, pb_msg, project_ns=False):
""" Serialize a protobuf message into JSON
Arguments:
pb_msg - A GI-protobuf object of type provided into constructor
+ project_ns - Need the desc in project namespace, required for
+ posting to Restconf as part of onboarding
Returns:
A JSON string representing the protobuf message
SerializationError - Message could not be serialized
TypeError - Incorrect protobuf type provided
"""
- if not isinstance(pb_msg, self._yang_pb_cls):
- raise TypeError("Invalid protobuf message type provided")
-
try:
- json_str = pb_msg.to_json(self.model)
+ # json_str = pb_msg.to_json(self.model)
+
+ desc_msg = self.to_desc_msg(pb_msg, not project_ns)
+ json_str = desc_msg.to_json(self.model)
+ if project_ns:
+ # Remove rw-project:project top level element
+ dic = json.loads(json_str)
+ jstr = json.dumps(dic[NS_PROJECT][0])
- # Remove rw-project:project top level element
- dic = json.loads(json_str)
- jstr = json.dumps(dic[NS_PROJECT][0])
except Exception as e:
raise SerializationError(e)
- log = logging.getLogger('rw-mano-log')
- log.error("Desc to json: {}".format(jstr))
+ self._log.debug("Convert desc to json: {}".format(jstr))
return jstr
def to_yaml_string(self, pb_msg):
SerializationError - Message could not be serialized
TypeError - Incorrect protobuf type provided
"""
- if not isinstance(pb_msg, self._yang_pb_cls):
- raise TypeError("Invalid protobuf message type provided")
-
try:
- yaml_str = pb_msg.to_yaml(self.model)
+ desc_msg = self.to_desc_msg(pb_msg)
+ yaml_str = desc_msg.to_yaml(self.model)
except Exception as e:
+ self._log.exception("Exception converting to yaml: {}".format(e))
raise SerializationError(e)
return yaml_str
SerializationError - Message could not be serialized
TypeError - Incorrect protobuf type provided
"""
- if not isinstance(pb_msg, self._yang_pb_cls):
- raise TypeError("Invalid protobuf message type provided")
-
try:
- xml_str = pb_msg.to_xml_v2(self.model)
+ desc_msg = self.to_desc_msg(pb_msg)
+ xml_str = desc_msg.to_xml_v2(self.model)
except Exception as e:
+ self._log.exception("Exception converting to xml: {}".format(e))
raise SerializationError(e)
return xml_str
class VnfdSerializer(ProtoMessageSerializer):
""" Creates a serializer for the VNFD descriptor"""
def __init__(self):
- super().__init__(VnfdYang, VnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd)
+ super().__init__(VnfdYang, VnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd,
+ ProjectVnfdYang, ProjectVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd)
class NsdSerializer(ProtoMessageSerializer):
""" Creates a serializer for the NSD descriptor"""
def __init__(self):
- super().__init__(NsdYang, NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd)
+ super().__init__(NsdYang, NsdYang.YangData_Nsd_NsdCatalog_Nsd,
+ ProjectNsdYang, ProjectNsdYang.YangData_RwProject_Project_NsdCatalog_Nsd)
class RwVnfdSerializer(ProtoMessageSerializer):
""" Creates a serializer for the VNFD descriptor"""
def __init__(self):
- super().__init__(RwVnfdYang, RwVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd)
+ super().__init__(RwVnfdYang, RwVnfdYang.YangData_Vnfd_VnfdCatalog_Vnfd,
+ RwProjectVnfdYang, RwProjectVnfdYang.YangData_RwProject_Project_VnfdCatalog_Vnfd)
class RwNsdSerializer(ProtoMessageSerializer):
""" Creates a serializer for the NSD descriptor"""
def __init__(self):
- super().__init__(RwNsdYang, RwNsdYang.YangData_RwProject_Project_NsdCatalog_Nsd)
+ super().__init__(RwNsdYang, RwNsdYang.YangData_Nsd_NsdCatalog_Nsd,
+ RwProjectNsdYang, RwProjectNsdYang.YangData_RwProject_Project_NsdCatalog_Nsd)
-#
-# Copyright 2016 RIFT.IO Inc
+#
+# 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.
from . import tosca
import gi
-gi.require_version('NsdYang', '1.0')
-gi.require_version('VnfdYang', '1.0')
gi.require_version('RwPkgMgmtYang', '1.0')
from gi.repository import (
- NsdYang,
- VnfdYang,
RwPkgMgmtYang)
import rift.mano.dts as mano_dts
from rift.mano.utils.project import DEFAULT_PROJECT
from rift.package import convert
from gi.repository import (
- NsdYang,
- RwNsdYang,
- VnfdYang,
- RwVnfdYang,
+ ProjectNsdYang as NsdYang,
+ RwProjectNsdYang as RwNsdYang,
+ ProjectVnfdYang as VnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
)
raise TypeError("Invalid descriptor message type")
serializer = DescriptorOnboarder.DESC_SERIALIZER_MAP[type(descriptor_msg)]
- json_data = serializer.to_json_string(descriptor_msg)
+ json_data = serializer.to_json_string(descriptor_msg, project_ns=True)
url = self._get_url(descriptor_msg, project=project)
request_args = dict(
class NsdCatalogDtsHandler(CatalogDtsHandler):
- XPATH = "C,/nsd:nsd-catalog/nsd:nsd"
+ XPATH = "C,/project-nsd:nsd-catalog/project-nsd:nsd"
def add_nsd(self, nsd):
self.log.debug('nsd-catalog-handler:add:{}'.format(nsd.id))
class VnfdCatalogDtsHandler(CatalogDtsHandler):
- XPATH = "C,/vnfd:vnfd-catalog/vnfd:vnfd"
+ XPATH = "C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd"
def add_vnfd(self, vnfd):
self.log.debug('vnfd-catalog-handler:add:{}'.format(vnfd.id))
import gi
gi.require_version('RwLaunchpadYang', '1.0')
-gi.require_version('NsdYang', '1.0')
-gi.require_version('VnfdYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
+gi.require_version('ProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
- VnfdYang,
+ ProjectNsdYang as NsdYang,
+ ProjectVnfdYang as VnfdYang,
)
import rift.mano.cloud
js['error']))
try:
- nsd = js['nsd:nsd']
+ nsd = js['project-nsd:nsd']
except KeyError as e:
raise OnboardPkgNsdError("NSD ID {} provided is not valid".
format(self._nsd_id))
self.log.debug("NSD list: {}".format(js))
print('List of NSDs on SO:\nName\tID')
- for nsd in js['nsd:nsd']:
+ for nsd in js['project-nsd:nsd']:
print('{}\t{}'.format(nsd['name'], nsd['id']))
except OnboardPkgCmdError as e:
from rift.tasklets.rwlaunchpad import export
import gi
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('ProjectVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
from gi.repository import (
- RwVnfdYang,
- VnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ ProjectVnfdYang as VnfdYang,
)
import utest_package
from rift.package.handler import FileRestApiHandler
import gi
-gi.require_version('NsdYang', '1.0')
-gi.require_version('VnfdYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
+gi.require_version('ProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
- VnfdYang,
+ ProjectNsdYang as NsdYang,
+ ProjectVnfdYang as VnfdYang,
)
import rift.test.dts
import gi
-gi.require_version('NsdYang', '1.0')
-gi.require_version('VnfdYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
+gi.require_version('ProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
- VnfdYang,
+ ProjectNsdYang as NsdYang,
+ ProjectVnfdYang as VnfdYang,
)
)
-nsd_yaml = b"""nsd:nsd-catalog:
- nsd:nsd:
- - nsd:id: gw_corpA
- nsd:name: gw_corpA
- nsd:description: Gateways to access as corpA to PE1 and PE2
+nsd_yaml = b"""project-nsd:nsd-catalog:
+ project-nsd:nsd:
+ - project-nsd:id: gw_corpA
+ project-nsd:name: gw_corpA
+ project-nsd:description: Gateways to access as corpA to PE1 and PE2
"""
-vnfd_yaml = b"""vnfd:vnfd-catalog:
- vnfd:vnfd:
- - vnfd:id: gw_corpA_vnfd
- vnfd:name: gw_corpA_vnfd
- vnfd:description: Gateways to access as corpA to PE1 and PE2
+vnfd_yaml = b"""project-vnfd:vnfd-catalog:
+ project-vnfd:vnfd:
+ - project-vnfd:id: gw_corpA_vnfd
+ project-vnfd:name: gw_corpA_vnfd
+ project-vnfd:description: Gateways to access as corpA to PE1 and PE2
"""
nsd_filename = "gw_corpA__nsd.yaml"
json_str = package.json_descriptor
desc_dict = json.loads(json_str)
- self.assertIn("nsd:nsd-catalog", desc_dict)
+ self.assertIn("project-nsd:nsd-catalog", desc_dict)
def test_create_vnfd_package_from_archive(self):
package = self.create_vnfd_package()
json_str = package.json_descriptor
desc_dict = json.loads(json_str)
- self.assertIn("vnfd:vnfd-catalog", desc_dict)
+ self.assertIn("project-vnfd:vnfd-catalog", desc_dict)
def test_create_vnfd_archive_from_package(self):
package = self.create_vnfd_package()
import tornado.web
import tornado.httputil
-import gi
import requests
from tornado.platform.asyncio import AsyncIOMainLoop
from tornado.ioloop import IOLoop
from concurrent.futures.thread import ThreadPoolExecutor
from concurrent.futures.process import ProcessPoolExecutor
+
+import gi
gi.require_version('RwDts', '1.0')
gi.require_version('RwPkgMgmtYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
from gi.repository import (
RwDts as rwdts,
RwPkgMgmtYang,
- RwVnfdYang
-
+ RwProjectVnfdYang as RwVnfdYang,
)
import rift.tasklets.rwlaunchpad.uploader as uploader
RwLaunchpadYang as launchpadyang,
RwDts as rwdts,
RwVnfrYang,
- RwVnfdYang,
- RwNsdYang
+ RwProjectVnfdYang as RwVnfdYang,
+ RwProjectNsdYang as RwNsdYang,
)
import utest_mon_params
from gi.repository import (
RwDts as rwdts,
RwTypes,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwYang
)
import rift.tasklets
data = vnfd.to_json(model)
- key = "vnfd:vnfd-catalog"
+ key = "project-vnfd:vnfd-catalog"
newdict = json.loads(data)
if key in newdict:
data = json.dumps(newdict[key])
import gi
gi.require_version('RwYang', '1.0')
-gi.require_version('RwNsdYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
gi.require_version('RwDts', '1.0')
gi.require_version('RwNsmYang', '1.0')
gi.require_version('RwNsrYang', '1.0')
RwYang,
RwNsrYang,
NsrYang,
- NsdYang,
+ ProjectNsdYang as NsdYang,
RwVlrYang,
VnfrYang,
RwVnfrYang,
for conn in self.vld_msg.vnfd_connection_point_ref:
for vnfr in vnfrs:
if (vnfr.vnfd.id == conn.vnfd_id_ref and
- vnfr.member_vnf_index == conn.member_vnf_index_ref and
+ str(vnfr.member_vnf_index) == conn.member_vnf_index_ref and
self.cloud_account_name == vnfr.cloud_account_name and
self.om_datacenter_name == vnfr.om_datacenter_name):
cp_entry = nsr_vlr.vnfr_connection_point_ref.add()
for vnfd_cp in vlr.vld_msg.vnfd_connection_point_ref:
if (vnfd_cp.vnfd_id_ref == self._vnfd.id and
vnfd_cp.vnfd_connection_point_ref == conn.name and
- vnfd_cp.member_vnf_index_ref == self.member_vnf_index and
+ vnfd_cp.member_vnf_index_ref == str(self.member_vnf_index) and
vlr.cloud_account_name == self.cloud_account_name):
self._log.debug("Found VLR for cp_name:%s and vnf-index:%d",
conn.name, self.member_vnf_index)
return None
# For every connection point in the VNFD fill in the identifier
+ self._log.debug("Add connection point for VNF %s: %s",
+ self.vnfr_msg.name, self._vnfd.connection_point)
for conn_p in self._vnfd.connection_point:
cpr = VnfrYang.YangData_RwProject_Project_VnfrCatalog_Vnfr_ConnectionPoint()
cpr.name = conn_p.name
self._log.info("Created VNF with xpath %s and vnfr %s",
self.xpath, self.vnfr_msg)
- self._log.info("Instantiated VNFR with xpath %s and vnfd %s, vnfr %s",
- self.xpath, self._vnfd, self.vnfr_msg)
-
@asyncio.coroutine
def update_state(self, vnfr_msg):
""" Update this VNFR"""
""" Fetch Cloud Account for the passed vnfd id """
if self._nsr_cfg_msg.vnf_cloud_account_map:
vim_accounts = [(vnf.cloud_account,vnf.om_datacenter) for vnf in self._nsr_cfg_msg.vnf_cloud_account_map \
- if vnfd_member_index == vnf.member_vnf_index_ref]
+ if str(vnfd_member_index) == vnf.member_vnf_index_ref]
if vim_accounts and vim_accounts[0]:
return vim_accounts[0]
return (self.cloud_account_name,self.om_datacenter_name)
for group in self.nsd_msg.placement_groups:
for member_vnfd in group.member_vnfd:
if (member_vnfd.vnfd_id_ref == vnfd_msg.id) and \
- (member_vnfd.member_vnf_index_ref == const_vnfd.member_vnf_index):
+ (member_vnfd.member_vnf_index_ref == str(const_vnfd.member_vnf_index)):
group_info = self.resolve_placement_group_cloud_construct(group)
if group_info is None:
self._log.error("Could not resolve cloud-construct for placement group: %s", group.name)
def nsd_xpath(self):
""" Return NSD config xpath."""
return self._project.add_project((
- "C,/nsd:nsd-catalog/nsd:nsd[nsd:id = '{}']"
+ "C,/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id = '{}']"
).format(self.nsd_id))
@asyncio.coroutine
def path_for_id(nsd_id):
""" Return path for the passed nsd_id"""
return self._nsm._project.add_project(
- "C,/nsd:nsd-catalog/nsd:nsd[nsd:id = '{}'".
+ "C,/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id = '{}'".
format(nsd_id))
def path(self):
class NsdDtsHandler(object):
""" The network service descriptor DTS handler """
- XPATH = "C,/nsd:nsd-catalog/nsd:nsd"
+ XPATH = "C,/project-nsd:nsd-catalog/project-nsd:nsd"
def __init__(self, dts, log, loop, nsm):
self._dts = dts
class VnfdDtsHandler(object):
""" DTS handler for VNFD config changes """
- XPATH = "C,/vnfd:vnfd-catalog/vnfd:vnfd"
+ XPATH = "C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd"
def __init__(self, dts, log, loop, nsm):
self._dts = dts
-#
-# Copyright 2016 RIFT.IO Inc
+#
+# 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.
from enum import Enum
-from gi.repository import NsdYang, NsrYang
+from gi.repository import (
+ ProjectNsdYang as NsdYang,
+ NsrYang
+ )
class ScalingGroupIndexExists(Exception):
@staticmethod
def vnfd_xpath(vnfd_id):
""" VNFD xpath associated with this VNFR """
- return ("C,/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = '{}']".
+ return ("C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd[project-vnfd:id = '{}']".
format(vnfd_id))
@property
class VnfdDtsHandler(object):
""" DTS handler for VNFD config changes """
- XPATH = "C,/vnfd:vnfd-catalog/vnfd:vnfd"
+ XPATH = "C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd"
def __init__(self, dts, log, loop, vnfm):
self._dts = dts
prefix "rwcal";
}
- import rw-vnfd {
- prefix "rw-vnfd";
+ import rw-project-vnfd {
+ prefix "rw-project-vnfd";
}
import vld {
prefix "vld";
}
- import rw-nsd {
- prefix "rw-nsd";
+ import rw-project-nsd {
+ prefix "rw-project-nsd";
}
import rw-cloud {
prefix "inet";
}
- import rw-nsd {
- prefix "rw-nsd";
+ import rw-project-nsd {
+ prefix "rw-project-nsd";
}
- import nsd {
- prefix "nsd";
+
+ import project-nsd {
+ prefix "project-nsd";
}
+
import rw-nsr {
prefix "rw-nsr";
}
+
import vld {
prefix "vld";
}
+
import rw-vlr {
prefix "rw-vlr";
}
+
import rw-vns {
prefix "rw-vns";
}
- import rw-vnfd {
- prefix "rw-vnfd";
+
+ import rw-project-vnfd {
+ prefix "rw-project-vnfd";
}
- import vnfd {
- prefix "vnfd";
+
+ import project-vnfd {
+ prefix "project-vnfd";
}
+
import rw-vnfr {
prefix "rw-vnfr";
}
prefix "rw-vns";
}
- import rw-vnfd {
- prefix "rw-vnfd";
+ import rw-project-vnfd {
+ prefix "rw-project-vnfd";
}
import rw-vnfr {
import tempfile
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwNsrYang,
RwVnfrYang,
VnfrYang,
VldYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwLaunchpadYang,
RwBaseYang
)
import uuid
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwNsrYang,
VnfrYang,
VldYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwLaunchpadYang,
RwBaseYang
)
nsd = catalog.nsd[0]
input_parameters = []
- descr_xpath = "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id='%s']/nsd:description" % nsd.id
+ descr_xpath = "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id='%s']/project-nsd:description" % nsd.id
descr_value = "New NSD Description"
in_param_id = str(uuid.uuid4())
import uuid
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwNsrYang,
VnfrYang,
VldYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwLaunchpadYang,
RwBaseYang
)
nsd = catalog.nsd[0]
input_parameters = []
- descr_xpath = "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id='%s']/nsd:description" % nsd.id
+ descr_xpath = "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id='%s']/project-nsd:description" % nsd.id
descr_value = "New NSD Description"
in_param_id = str(uuid.uuid4())
import pytest
-from gi.repository import NsrYang, RwNsrYang, RwVnfrYang, NsdYang, RwNsdYang
+from gi.repository import (
+ NsrYang,
+ RwNsrYang,
+ RwVnfrYang,
+ ProjectNsdYang as NsdYang,
+ RwProjectNsdYang as RwNsdYang
+ )
import rift.auto.session
@pytest.fixture(scope='module')
import gi
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwLaunchpadYang', '1.0')
gi.require_version('RwBaseYang', '1.0')
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
RwNsrYang,
RwVnfrYang,
NsrYang,
VnfrYang,
VldYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwLaunchpadYang,
RwBaseYang
)
nsd = catalog.nsd[0]
input_parameters = []
- descr_xpath = "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id='%s']/nsd:vendor" % nsd.id
+ descr_xpath = "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id='%s']/project-nsd:vendor" % nsd.id
descr_value = "automation"
in_param_id = str(uuid.uuid4())
nsd = catalog.nsd[0]
input_parameters = []
- descr_xpath = "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id='%s']/nsd:vendor" % nsd.id
+ descr_xpath = "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id='%s']/project-nsd:vendor" % nsd.id
descr_value = "automation"
in_param_id = str(uuid.uuid4())
import re
gi.require_version('RwNsrYang', '1.0')
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
RwBaseYang,
RwConmanYang,
RwNsrYang,
- RwNsdYang,
+ RwProjectNsdYang as RwNsdYang,
RwVcsYang,
RwVlrYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwVnfrYang,
VlrYang,
VnfrYang,
from gi.repository import (
NsrYang,
- NsdYang,
+ ProjectNsdYang as NsdYang,
VnfrYang,
RwNsrYang,
- RwNsdYang,
+ RwProjectNsdYang as RwNsdYang,
RwVnfrYang,
)
import gi
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwLaunchpadYang', '1.0')
gi.require_version('RwBaseYang', '1.0')
from gi.repository import (
RwcalYang,
- NsdYang,
+ ProjectNsdYang as NsdYang,
RwNsrYang,
RwVnfrYang,
NsrYang,
VnfrYang,
VldYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwLaunchpadYang,
RwBaseYang
)
nsd = catalog.nsd[0]
input_parameters = []
- descr_xpath = "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id='%s']/nsd:description" % nsd.id
+ descr_xpath = "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id='%s']/project-nsd:description" % nsd.id
descr_value = "New NSD Description"
in_param_id = str(uuid.uuid4())
import subprocess
import gi
-from gi.repository import RwVnfdYang
+from gi.repository import RwProjectVnfdYang as RwVnfdYang
from gi.repository import RwVnfrYang
import rift.auto.proxy
class XPaths(object):
@staticmethod
def nsd(k=None):
- return ("C,/nsd:nsd-catalog/nsd:nsd" +
- ("[nsd:id='{}']".format(k) if k is not None else ""))
+ return ("C,/project-nsd:nsd-catalog/project-nsd:nsd" +
+ ("[project-nsd:id='{}']".format(k) if k is not None else ""))
@staticmethod
def vld(k=None):
@staticmethod
def vnfd(k=None):
- return ("C,/vnfd:vnfd-catalog/vnfd:vnfd" +
- ("[vnfd:id='{}']".format(k) if k is not None else ""))
+ return ("C,/project-vnfd:vnfd-catalog/project-vnfd:vnfd" +
+ ("[project-vnfd:id='{}']".format(k) if k is not None else ""))
@staticmethod
def vnfr(k=None):
inputs = nsryang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter()
inputs.xpath = self.project.add_project(
- "/nsd:nsd-catalog/nsd:nsd[nsd:id={}]/nsd:name".format(ping_pong.nsd_id))
+ "/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id={}]/project-nsd:name".format(ping_pong.nsd_id))
inputs.value = "inigo montoya"
fast_cpu = {'metadata_key': 'FASTCPU', 'metadata_value': 'True'}
nsr_config = nsr_configs[0]
self.assertEqual(
- "/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id={}]/nsd:name".format(self.ping_pong.nsd_id),
+ "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id={}]/project-nsd:name".format(self.ping_pong.nsd_id),
nsr_config.input_parameter[0].xpath,
)
gi.require_version('RwNsrYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
gi.require_version('RwConmanYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwBaseYang,
RwCloudYang,
RwNsrYang,
RwResourceMgrYang,
RwConmanYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
VldYang,
)
gi.require_version('RwIwpYang', '1.0')
gi.require_version('RwNsmYang', '1.0')
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwNsrYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
gi.require_version('RwConmanYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwBaseYang,
RwCloudYang,
RwNsrYang,
RwResourceMgrYang,
RwConmanYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
VldYang,
)
gi.require_version('RwIwpYang', '1.0')
gi.require_version('RwlogMgmtYang', '1.0')
gi.require_version('RwNsmYang', '1.0')
-gi.require_version('RwNsmYang', '1.0')
+gi.require_version('ProjectNsdYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
gi.require_version('RwConmanYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
RwBaseYang,
RwCloudYang,
RwNsrYang,
RwResourceMgrYang,
RwConmanYang,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
VldYang,
)
nsr.cloud_account = "openstack"
param = NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter()
- param.xpath = '/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:vendor'
+ param.xpath = '/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:vendor'
param.value = "rift-o-matic"
nsr.input_parameter.append(param)
import gi
gi.require_version('RwIwpYang', '1.0')
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwCloudYang', '1.0')
gi.require_version('RwBaseYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
-from gi.repository import RwIwpYang, NsdYang, NsrYang, RwNsrYang, VldYang, RwVnfdYang, RwCloudYang, RwBaseYang, RwResourceMgrYang, RwConmanYang, RwNsmYang
+from gi.repository import (
+ RwIwpYang,
+ ProjectNsdYang as NsdYang,
+ NsrYang,
+ RwNsrYang,
+ VldYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwCloudYang,
+ RwBaseYang,
+ RwResourceMgrYang,
+ RwConmanYang,
+ RwNsmYang
+)
logging.basicConfig(level=logging.DEBUG)
import gi
gi.require_version('RwIwpYang', '1.0')
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwCloudYang', '1.0')
gi.require_version('RwBaseYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
gi.require_version('RwConmanYang', '1.0')
gi.require_version('RwNsmYang', '1.0')
-
-
-from gi.repository import RwIwpYang, NsdYang, NsrYang, RwNsrYang, VldYang, RwVnfdYang, RwCloudYang, RwBaseYang, RwResourceMgrYang, RwConmanYang, RwNsmYang
+from gi.repository import (
+ RwIwpYang,
+ ProjectNsdYang as NsdYang,
+ NsrYang,
+ RwNsrYang,
+ VldYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwCloudYang,
+ RwBaseYang,
+ RwResourceMgrYang,
+ RwConmanYang,
+ RwNsmYang
+ )
logging.basicConfig(level=logging.DEBUG)
import gi
gi.require_version('RwIwpYang', '1.0')
gi.require_version('RwNsrYang', '1.0')
-gi.require_version('RwVnfdYang', '1.0')
+gi.require_version('RwProjectVnfdYang', '1.0')
gi.require_version('RwCloudYang', '1.0')
gi.require_version('RwBaseYang', '1.0')
gi.require_version('RwResourceMgrYang', '1.0')
gi.require_version('RwNsmYang', '1.0')
-from gi.repository import RwIwpYang, NsdYang, NsrYang, RwNsrYang, VldYang, RwVnfdYang, RwCloudYang, RwBaseYang, RwResourceMgrYang, RwConmanYang, RwNsmYang
+from gi.repository import (
+ RwIwpYang,
+ ProjectNsdYang,
+ NsrYang,
+ RwNsrYang,
+ VldYang,
+ RwProjectVnfdYang as RwVnfdYang,
+ RwCloudYang,
+ RwBaseYang,
+ RwResourceMgrYang,
+ RwConmanYang,
+ RwNsmYang
+ )
logging.basicConfig(level=logging.DEBUG)
from gi.repository import (
RwLaunchpadYang as launchpadyang,
RwDts as rwdts,
- RwVnfdYang,
+ RwProjectVnfdYang as RwVnfdYang,
RwVnfrYang,
RwNsrYang,
- RwNsdYang,
+ RwProjectNsdYang as RwNsdYang,
VnfrYang
)
)
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
import xmlrunner
from gi.repository import (
- NsdYang,
+ ProjectNsdYang as NsdYang,
NsrYang,
)
)
# Retrieve the NSD using and xpath expression
- xpath = '/rw-project:project/nsd:nsd-catalog/nsd:nsd[nsd:id={}]'.format(nsd_id)
+ xpath = '/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd[project-nsd:id={}]'.format(nsd_id)
nsd = rwxpath.getxattr(nsd_catalog, xpath)
self.assertEqual(nsd_id, nsd.id)
# Modified the name of the NSD using an xpath expression
- rwxpath.setxattr(nsd_catalog, xpath + "/nsd:name", "test-name")
+ rwxpath.setxattr(nsd_catalog, xpath + "/project-nsd:name", "test-name")
- name = rwxpath.getxattr(nsd_catalog, xpath + "/nsd:name")
+ name = rwxpath.getxattr(nsd_catalog, xpath + "/project-nsd:name")
self.assertEqual("test-name", name)
def test_nsd_scalar_fields(self):
nsd = NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd()
# Check that the unset fields are in fact set to None
- self.assertEqual(None, rwxpath.getxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name"))
- self.assertEqual(None, rwxpath.getxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name"))
+ self.assertEqual(None, rwxpath.getxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name"))
+ self.assertEqual(None, rwxpath.getxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name"))
# Set the values of the 'name' and 'short-name' fields
- rwxpath.setxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name", "test-name")
- rwxpath.setxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name", "test-short-name")
+ rwxpath.setxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name", "test-name")
+ rwxpath.setxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name", "test-short-name")
# Check that the 'name' and 'short-name' fields are correctly set
- self.assertEqual(nsd.name, rwxpath.getxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name"))
- self.assertEqual(nsd.short_name, rwxpath.getxattr(nsd, "/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name"))
+ self.assertEqual(nsd.name, rwxpath.getxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name"))
+ self.assertEqual(nsd.short_name, rwxpath.getxattr(nsd, "/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name"))
class TestInputParameterSubstitution(unittest.TestCase):
# Define which parameters may be modified
nsd.input_parameter_xpath.append(
NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd_InputParameterXpath(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name",
label="NSD Name",
)
)
nsr_config = NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr()
nsr_config.input_parameter.extend([
NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name",
value="alice",
),
NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name",
value="alice",
),
])
# Define which parameters may be modified
nsd.input_parameter_xpath.extend([
NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd_InputParameterXpath(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name",
label="NSD Name",
),
NsdYang.YangData_RwProject_Project_NsdCatalog_Nsd_InputParameterXpath(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name",
label="NSD Short Name",
),
])
nsr_config = NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr()
nsr_config.input_parameter.extend([
NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:name",
value="robert",
),
NsrYang.YangData_RwProject_Project_NsInstanceConfig_Nsr_InputParameter(
- xpath="/rw-project:project/nsd:nsd-catalog/nsd:nsd/nsd:short-name",
+ xpath="/rw-project:project/project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:short-name",
value="bob",
),
])